中英文切换根据已有的功能 已经基本完善

This commit is contained in:
mmc
2026-08-14 13:33:13 +08:00
parent 62b03bba03
commit 027455272b
18 changed files with 561 additions and 481 deletions

View File

@@ -1,7 +1,8 @@
import React, { useEffect, useState, useRef } from 'react';
import { useTranslation } from 'react-i18next';
const XboxController = ({ onGamepadUpdate, handleControlModal, isControlled, isConnecting, hasControlRight }) => {
const { t } = useTranslation();
const [gamepadState, setGamepadState] = useState<{
buttons: boolean[];
axes: number[];
@@ -135,15 +136,15 @@ const XboxController = ({ onGamepadUpdate, handleControlModal, isControlled, isC
`}
>
{!connected ? (
'未连接设备'
t('devices.controllerNotConnected')
) : !hasControlRight ? (
'其他 Web 端已连接'
t('devices.otherWebConnected')
) : isConnecting ? (
'请求控制中...'
t('devices.control2')
) : isControlled ? (
'控制中'
t('devices.controlling')
) : (
'点击获取控制权限'
t('devices.clickToRequestControl')
)}
</div>