Skip to content

Commit 501dbfa

Browse files
committed
ru-UI
1 parent a0afe15 commit 501dbfa

9 files changed

Lines changed: 58 additions & 28 deletions

File tree

packages/react/src/components/ConnectionStateToast.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ export function ConnectionStateToast(props: ConnectionStateToastProps) {
2424
case ConnectionState.Reconnecting:
2525
setNotification(
2626
<>
27-
<SpinnerIcon className="lk-spinner" /> Reconnecting
27+
<SpinnerIcon className="lk-spinner" /> Повторное подключение
2828
</>,
2929
);
3030
break;
3131
case ConnectionState.Connecting:
3232
setNotification(
3333
<>
34-
<SpinnerIcon className="lk-spinner" /> Connecting
34+
<SpinnerIcon className="lk-spinner" /> Подключение
3535
</>,
3636
);
3737
break;
3838
case ConnectionState.Disconnected:
39-
setNotification(<>Disconnected</>);
39+
setNotification(<>Отключено</>);
4040
break;
4141
default:
4242
setNotification(undefined);

packages/react/src/components/controls/StartAudio.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Room } from 'livekit-client';
66
/** @public */
77
export interface AllowAudioPlaybackProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
88
room?: Room;
9-
label: string;
9+
label?: string;
1010
}
1111

1212
/**
@@ -27,7 +27,7 @@ export interface AllowAudioPlaybackProps extends React.ButtonHTMLAttributes<HTML
2727
export const StartAudio: (
2828
props: AllowAudioPlaybackProps & React.RefAttributes<HTMLButtonElement>,
2929
) => React.ReactNode = /* @__PURE__ */ React.forwardRef<HTMLButtonElement, AllowAudioPlaybackProps>(
30-
function StartAudio({ label = 'Allow Audio', ...props }: AllowAudioPlaybackProps, ref) {
30+
function StartAudio({ label = 'Разрешить звук', ...props }: AllowAudioPlaybackProps, ref) {
3131
const room = useEnsureRoom(props.room);
3232
const { mergedProps } = useStartAudio({ room, props });
3333

packages/react/src/components/controls/StartMediaButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const StartMediaButton: (
3434

3535
return (
3636
<button ref={ref} style={style} {...restProps}>
37-
{label ?? `Start ${!canPlayAudio ? 'Audio' : 'Video'}`}
37+
{label ?? `Включить ${!canPlayAudio ? 'Звук' : 'Видео'}`}
3838
</button>
3939
);
4040
},

packages/react/src/i18n.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
export type Lang = "en" | "ru";
2+
3+
let currentLang: Lang = "en";
4+
5+
export const texts = {
6+
connecting: {
7+
en: "Connecting...",
8+
ru: "Подключение..."
9+
},
10+
disconnected: {
11+
en: "Disconnected",
12+
ru: "Отключено"
13+
},
14+
mute: {
15+
en: "Mute",
16+
ru: "Выключить микрофон"
17+
},
18+
camera: {
19+
en: "Camera",
20+
ru: "Камера"
21+
}
22+
};
23+
24+
export function setLang(lang: Lang) {
25+
currentLang = lang;
26+
}
27+
28+
export function t(key: keyof typeof texts) {
29+
return texts[key][currentLang];
30+
}

packages/react/src/prefabs/Chat.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function Chat({
100100
return (
101101
<div {...props} className="lk-chat">
102102
<div className="lk-chat-header">
103-
Messages
103+
Сообщения
104104
{layoutContext && (
105105
<ChatToggle className="lk-close-button">
106106
<ChatCloseIcon />
@@ -139,13 +139,13 @@ export function Chat({
139139
disabled={isSending}
140140
ref={inputRef}
141141
type="text"
142-
placeholder="Enter a message..."
142+
placeholder="Введите сообщение"
143143
onInput={(ev) => ev.stopPropagation()}
144144
onKeyDown={(ev) => ev.stopPropagation()}
145145
onKeyUp={(ev) => ev.stopPropagation()}
146146
/>
147147
<button type="submit" className="lk-button lk-chat-form-button" disabled={isSending}>
148-
Send
148+
Отправить
149149
</button>
150150
</form>
151151
</div>

packages/react/src/prefabs/ControlBar.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export function ControlBar({
160160
onChange={microphoneOnChange}
161161
onDeviceError={(error) => onDeviceError?.({ source: Track.Source.Microphone, error })}
162162
>
163-
{showText && 'Microphone'}
163+
{showText && 'Микрофон'}
164164
</TrackToggle>
165165
<div className="lk-button-group-menu">
166166
<MediaDeviceMenu
@@ -180,7 +180,7 @@ export function ControlBar({
180180
onChange={cameraOnChange}
181181
onDeviceError={(error) => onDeviceError?.({ source: Track.Source.Camera, error })}
182182
>
183-
{showText && 'Camera'}
183+
{showText && 'Камера'}
184184
</TrackToggle>
185185
<div className="lk-button-group-menu">
186186
<MediaDeviceMenu
@@ -200,25 +200,25 @@ export function ControlBar({
200200
onChange={onScreenShareChange}
201201
onDeviceError={(error) => onDeviceError?.({ source: Track.Source.ScreenShare, error })}
202202
>
203-
{showText && (isScreenShareEnabled ? 'Stop screen share' : 'Share screen')}
203+
{showText && (isScreenShareEnabled ? 'Остановить показ экрана' : 'Поделиться экраном')}
204204
</TrackToggle>
205205
)}
206206
{visibleControls.chat && (
207207
<ChatToggle>
208208
{showIcon && <ChatIcon />}
209-
{showText && 'Chat'}
209+
{showText && 'Чат'}
210210
</ChatToggle>
211211
)}
212212
{visibleControls.settings && (
213213
<SettingsMenuToggle>
214214
{showIcon && <GearIcon />}
215-
{showText && 'Settings'}
215+
{showText && 'Настройки'}
216216
</SettingsMenuToggle>
217217
)}
218218
{visibleControls.leave && (
219219
<DisconnectButton>
220220
{showIcon && <LeaveIcon />}
221-
{showText && 'Leave'}
221+
{showText && 'Выйти'}
222222
</DisconnectButton>
223223
)}
224224
<StartMediaButton />

packages/react/src/prefabs/MediaDeviceMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export function MediaDeviceMenu({
130130
/>
131131
) : (
132132
<>
133-
<div className="lk-device-menu-heading">Audio inputs</div>
133+
<div className="lk-device-menu-heading">Аудио-устройства</div>
134134
<MediaDeviceSelect
135135
kind="audioinput"
136136
onActiveDeviceChange={(deviceId) =>
@@ -140,7 +140,7 @@ export function MediaDeviceMenu({
140140
track={tracks?.audioinput}
141141
requestPermissions={needPermissions}
142142
/>
143-
<div className="lk-device-menu-heading">Video inputs</div>
143+
<div className="lk-device-menu-heading">Видео-устройства</div>
144144
<MediaDeviceSelect
145145
kind="videoinput"
146146
onActiveDeviceChange={(deviceId) =>

packages/react/src/prefabs/PreJoin.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ export function PreJoin({
223223
onSubmit,
224224
onError,
225225
debug,
226-
joinLabel = 'Join Room',
227-
micLabel = 'Microphone',
228-
camLabel = 'Camera',
229-
userLabel = 'Username',
226+
joinLabel = 'Войти в комнату',
227+
micLabel = 'Микрофон',
228+
camLabel = 'Камера',
229+
userLabel = 'Имя пользователя',
230230
persistUserChoices = true,
231231
videoProcessor,
232232
...htmlProps
@@ -424,13 +424,13 @@ export function PreJoin({
424424

425425
{debug && (
426426
<>
427-
<strong>User Choices:</strong>
427+
<strong>Выбор пользователя:</strong>
428428
<ul className="lk-list" style={{ overflow: 'hidden', maxWidth: '15rem' }}>
429-
<li>Username: {`${userChoices.username}`}</li>
430-
<li>Video Enabled: {`${userChoices.videoEnabled}`}</li>
431-
<li>Audio Enabled: {`${userChoices.audioEnabled}`}</li>
432-
<li>Video Device: {`${userChoices.videoDeviceId}`}</li>
433-
<li>Audio Device: {`${userChoices.audioDeviceId}`}</li>
429+
<li>Имя пользователя: {`${userChoices.username}`}</li>
430+
<li>Видео включено: {`${userChoices.videoEnabled}`}</li>
431+
<li>Аудио включено: {`${userChoices.audioEnabled}`}</li>
432+
<li>Видео-устройство: {`${userChoices.videoDeviceId}`}</li>
433+
<li>Аудио-устройство: {`${userChoices.audioDeviceId}`}</li>
434434
</ul>
435435
</>
436436
)}

packages/react/src/prefabs/VoiceAssistantControlBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function VoiceAssistantControlBar({
102102
</div>
103103
)}
104104

105-
{visibleControls.leave && <DisconnectButton>{'Disconnect'}</DisconnectButton>}
105+
{visibleControls.leave && <DisconnectButton>{'Отключиться'}</DisconnectButton>}
106106
<StartMediaButton />
107107
</div>
108108
);

0 commit comments

Comments
 (0)