feat(client): add RU/EN localization and native capture preview

This commit is contained in:
Loki 2026-10-24 15:04:50 +02:00
parent 8e5ab56611
commit 8460fb28fd
Signed by: boba
GPG key ID: 253067914055423B
43 changed files with 4103 additions and 275 deletions

View file

@ -9,6 +9,7 @@ export component VoicePanel inherits Rectangle {
in-out property <string> channel-name;
in-out property <string> activity-banner;
in-out property <bool> push-to-talk;
callback preview-screen();
callback ptt-held(bool);
callback toggle-mic();
callback toggle-deafen();
@ -23,11 +24,12 @@ export component VoicePanel inherits Rectangle {
Text { text: "◖"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 1.4375); width: 20px; vertical-alignment: center; }
Text { text: root.channel-name; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); font-weight: 600; vertical-alignment: center; }
Rectangle { horizontal-stretch: 1; }
ActionButton { text: @tr("Screen preview"); clicked => { root.preview-screen(); } }
}
}
VerticalLayout {
padding: 24px; spacing: 16px;
Text { text: root.members.length + " участников"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); }
Text { text: @tr("{n} participant" | "{n} participants" % root.members.length); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); }
Flickable {
content-width: self.width;
VerticalLayout {
@ -46,20 +48,20 @@ export component VoicePanel inherits Rectangle {
VerticalLayout {
spacing: 5px;
Text { text: member.nickname; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0625); }
Text { text: member.speaking ? "Говорит" : "В голосовой комнате"; color: member.speaking ? Theme.success : Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
Text { text: member.speaking ? @tr("Speaking") : @tr("In voice"); color: member.speaking ? Theme.success : Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
}
Rectangle { horizontal-stretch: 1; }
}
}
if root.members.length == 0 : Text { text: "Подключение к голосовой комнате…"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); }
if root.members.length == 0 : Text { text: @tr("Joining voice…"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); }
Rectangle { vertical-stretch: 1; }
}
}
if root.push-to-talk : Rectangle {
height: 46px; background: ptt-area.pressed ? Theme.voice-bg : Theme.bg-interactive;
border-radius: 8px; border-width: ptt-focus.has-focus ? 1px : 0px; border-color: Theme.accent;
accessible-role: button; accessible-label: "Удерживать для разговора";
Text { text: ptt-area.pressed ? "Микрофон передаёт звук" : "Удерживай здесь, чтобы говорить"; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); horizontal-alignment: center; vertical-alignment: center; }
accessible-role: button; accessible-label: @tr("Push to talk");
Text { text: ptt-area.pressed ? @tr("Microphone is transmitting") : @tr("Hold here to talk"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); horizontal-alignment: center; vertical-alignment: center; }
ptt-area := TouchArea {
clicked => { ptt-focus.focus(); }
changed pressed => { root.ptt-held(self.pressed); }
@ -74,9 +76,9 @@ export component VoicePanel inherits Rectangle {
HorizontalLayout {
spacing: 10px;
Rectangle { horizontal-stretch: 1; }
ActionButton { text: root.mic-enabled ? "Выключить микрофон" : "Включить микрофон"; danger: !root.mic-enabled; clicked => { root.toggle-mic(); } }
ActionButton { text: root.deafened ? "Включить звук" : "Выключить звук"; danger: root.deafened; clicked => { root.toggle-deafen(); } }
ActionButton { text: "Покинуть комнату"; danger: true; clicked => { root.leave-voice(); } }
ActionButton { text: root.mic-enabled ? @tr("Mute microphone") : @tr("Unmute microphone"); danger: !root.mic-enabled; clicked => { root.toggle-mic(); } }
ActionButton { text: root.deafened ? @tr("Undeafen") : @tr("Deafen"); danger: root.deafened; clicked => { root.toggle-deafen(); } }
ActionButton { text: @tr("Leave room"); danger: true; clicked => { root.leave-voice(); } }
Rectangle { horizontal-stretch: 1; }
}
}