🌐(frontend) internationalize video conference controls
Localized video conference controls to match the selected language. Previously, controls were always in English, causing confusion for French users. A full refactor of the controls is planned soon.
This commit is contained in:
committed by
aleb_the_flash
parent
bd26a0abc1
commit
217b19e42a
@@ -20,6 +20,7 @@ import { SettingsMenuToggle } from '../components/controls/SettingsMenuToggle'
|
|||||||
import { mergeProps } from '@/utils/mergeProps.ts'
|
import { mergeProps } from '@/utils/mergeProps.ts'
|
||||||
import { StartMediaButton } from '../components/controls/StartMediaButton'
|
import { StartMediaButton } from '../components/controls/StartMediaButton'
|
||||||
import { useMediaQuery } from '../hooks/useMediaQuery'
|
import { useMediaQuery } from '../hooks/useMediaQuery'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
/** @public */
|
/** @public */
|
||||||
export type ControlBarControls = {
|
export type ControlBarControls = {
|
||||||
@@ -68,6 +69,7 @@ export function ControlBar({
|
|||||||
onDeviceError,
|
onDeviceError,
|
||||||
...props
|
...props
|
||||||
}: ControlBarProps) {
|
}: ControlBarProps) {
|
||||||
|
const { t } = useTranslation('rooms')
|
||||||
const [isChatOpen, setIsChatOpen] = React.useState(false)
|
const [isChatOpen, setIsChatOpen] = React.useState(false)
|
||||||
const layoutContext = useMaybeLayoutContext()
|
const layoutContext = useMaybeLayoutContext()
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
@@ -152,7 +154,7 @@ export function ControlBar({
|
|||||||
onDeviceError?.({ source: Track.Source.Microphone, error })
|
onDeviceError?.({ source: Track.Source.Microphone, error })
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{showText && 'Microphone'}
|
{showText && t('controls.microphone')}
|
||||||
</TrackToggle>
|
</TrackToggle>
|
||||||
<div className="lk-button-group-menu">
|
<div className="lk-button-group-menu">
|
||||||
<MediaDeviceMenu
|
<MediaDeviceMenu
|
||||||
@@ -174,7 +176,7 @@ export function ControlBar({
|
|||||||
onDeviceError?.({ source: Track.Source.Camera, error })
|
onDeviceError?.({ source: Track.Source.Camera, error })
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{showText && 'Camera'}
|
{showText && t('controls.camera')}
|
||||||
</TrackToggle>
|
</TrackToggle>
|
||||||
<div className="lk-button-group-menu">
|
<div className="lk-button-group-menu">
|
||||||
<MediaDeviceMenu
|
<MediaDeviceMenu
|
||||||
@@ -197,25 +199,29 @@ export function ControlBar({
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{showText &&
|
{showText &&
|
||||||
(isScreenShareEnabled ? 'Stop screen share' : 'Share screen')}
|
t(
|
||||||
|
isScreenShareEnabled
|
||||||
|
? 'controls.stopScreenShare'
|
||||||
|
: 'controls.shareScreen'
|
||||||
|
)}
|
||||||
</TrackToggle>
|
</TrackToggle>
|
||||||
)}
|
)}
|
||||||
{visibleControls.chat && (
|
{visibleControls.chat && (
|
||||||
<ChatToggle>
|
<ChatToggle>
|
||||||
{showIcon && <ChatIcon />}
|
{showIcon && <ChatIcon />}
|
||||||
{showText && 'Chat'}
|
{showText && t('controls.chat')}
|
||||||
</ChatToggle>
|
</ChatToggle>
|
||||||
)}
|
)}
|
||||||
{visibleControls.settings && (
|
{visibleControls.settings && (
|
||||||
<SettingsMenuToggle>
|
<SettingsMenuToggle>
|
||||||
{showIcon && <GearIcon />}
|
{showIcon && <GearIcon />}
|
||||||
{showText && 'Settings'}
|
{showText && t('controls.settings')}
|
||||||
</SettingsMenuToggle>
|
</SettingsMenuToggle>
|
||||||
)}
|
)}
|
||||||
{visibleControls.leave && (
|
{visibleControls.leave && (
|
||||||
<DisconnectButton>
|
<DisconnectButton>
|
||||||
{showIcon && <LeaveIcon />}
|
{showIcon && <LeaveIcon />}
|
||||||
{showText && 'Leave'}
|
{showText && t('controls.leave')}
|
||||||
</DisconnectButton>
|
</DisconnectButton>
|
||||||
)}
|
)}
|
||||||
<StartMediaButton />
|
<StartMediaButton />
|
||||||
|
|||||||
@@ -22,5 +22,14 @@
|
|||||||
"heading": "",
|
"heading": "",
|
||||||
"body": ""
|
"body": ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"controls": {
|
||||||
|
"microphone": "",
|
||||||
|
"camera": "",
|
||||||
|
"shareScreen": "",
|
||||||
|
"stopScreenShare": "",
|
||||||
|
"chat": "",
|
||||||
|
"settings": "",
|
||||||
|
"leave": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,5 +22,14 @@
|
|||||||
"heading": "Authentication Required",
|
"heading": "Authentication Required",
|
||||||
"body": "This room has not been created yet. Please authenticate to create it or wait for an authenticated user to do so."
|
"body": "This room has not been created yet. Please authenticate to create it or wait for an authenticated user to do so."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"controls": {
|
||||||
|
"microphone": "Microphone",
|
||||||
|
"camera": "Camera",
|
||||||
|
"shareScreen": "Share screen",
|
||||||
|
"stopScreenShare": "Stop screen share",
|
||||||
|
"chat": "Chat",
|
||||||
|
"settings": "Settings",
|
||||||
|
"leave": "Leave"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,5 +22,14 @@
|
|||||||
"heading": "Authentification requise",
|
"heading": "Authentification requise",
|
||||||
"body": "Cette réunion n'a pas encore été créée. Veuillez vous authentifier pour la créer ou attendre qu'un utilisateur authentifié le fasse."
|
"body": "Cette réunion n'a pas encore été créée. Veuillez vous authentifier pour la créer ou attendre qu'un utilisateur authentifié le fasse."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"controls": {
|
||||||
|
"microphone": "Microphone",
|
||||||
|
"camera": "Camera",
|
||||||
|
"shareScreen": "Partager l'écran",
|
||||||
|
"stopScreenShare": "Arrêter le partage",
|
||||||
|
"chat": "Chat",
|
||||||
|
"settings": "Paramètres",
|
||||||
|
"leave": "Quitter"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user