中英文切换根据已有的功能 已经基本完善
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user