Merge Core main into german/hal-644-ar: Arabic on the Vue UI

Main moved the UI to Vue views and Pinia stores, so the Arabic changes to
the old DOM controllers now live in their views: the rail legend range
comes from formatScaleRange (keeping units a source supplies as given),
the voice timeout options are worded by Intl unit formatting in
VoiceControl, and the scene editor's JSON fields stay left to right in
SceneDialog. Main's CCTV status line, launch panel and calibration values
keep the Arabic isolates and Western-digit formatting.

isolate() and keepCodesWithValues() read the locale through getLocale(),
which follows the page's vue-i18n instance, and the Intl formatters take
intlLocale(getLocale()). A language switch now applies in place, and
applyDocumentLanguage sets <html dir> on every switch, so the page mirrors
without a reload.

The icon rails and their tips are placed with logical properties, so they
stay on the outer side of the mirrored stacks; Cyber's new stack offsets,
padding and edge lines are logical too, and rtl.css moves Cyber's right
stack to its new rail clearance. Main removed the Context mini radio, so its
right-to-left rules and test go.

The Arabic catalog gains main's new strings and drops the ones main no
longer uses; the other catalogs keep main's new keys and the branch's
landing labels.
This commit is contained in:
Sameh Khamis committed 2026-11-01 20:15:02 -08:00
commit bc5d038afd
630 files changed
+41141 -20956

No files matched your search

+136
View File
@@ -0,0 +1,136 @@
<script setup>
import { storeToRefs } from 'pinia';
import { formatNumber, t } from '../../../i18n/index.js';
import { vClassToggle } from '../../rail/classToggle.js';
import { useVoiceStore } from '../../stores/voice.js';
import VoiceCard from './VoiceCard.vue';
import VoiceVisualizer from './VoiceVisualizer.vue';
import UiButton from '../../kit/UiButton.vue';
import UiSelect from '../../kit/UiSelect.js';
// The voice control in the command dock, as its presenter
// (src/voice/control.js) holds it. The session owners write the presenter;
// this renders it and reports what the person does.
defineProps({ view: { type: Object, required: true } });
const { controls } = storeToRefs(useVoiceStore());
const emit = (name, ...args) => controls.value?.emit(name, ...args);
// A value the owner may restore after a refused change; written on every
// render, as the owner's own writes were.
const vChecked = {
mounted(el, { value }) {
el.checked = value;
},
updated(el, { value }) {
if (el.checked !== value) el.checked = value;
},
};
// The minutes field holds a draft until it changes: write it only when its
// owner does, not on every render (the waveform renders each frame).
const vOwnedValue = {
mounted(el, { value }) {
el.value = value.text;
},
updated(el, { value, oldValue }) {
if (value.revision !== oldValue?.revision && el.value !== value.text)
el.value = value.text;
},
};
// "5 minutes" in the UI language, with the count's plural form ("15 دقيقة").
const minutesLabel = (count) =>
formatNumber(count, { style: 'unit', unit: 'minute', unitDisplay: 'long' });
const optional = (value) => (value == null ? undefined : String(value));
// The root's machine-state attributes, which the dock and theme CSS select on.
const rootData = (root) => ({
'data-status': root.status,
'data-speaker': root.speaker,
'data-provider': optional(root.provider),
'data-provider-choice': optional(root.providerChoice),
'data-push-to-talk': optional(root.pushToTalk),
'data-microphone': optional(root.microphone),
'data-row-grace': root.rowGrace ? 'true' : undefined,
});
</script>
<template>
<div id="gev-voice-control" v-bind="rootData(view.root)" v-class-toggle="{ 'error-dismissed': view.root.errorDismissed }" @pointerleave="emit('pointerleave', $event)" @pointerenter="emit('pointerenter', $event)">
<label id="gev-voice-provider-field" class="gev-voice-provider-field" :hidden="view.provider.hidden">
<span>{{ t('Voice provider') }}</span>
<UiSelect id="gev-voice-provider" class="gev-field" :aria-label="t('Voice provider')" :title="view.provider.title" :model-value="view.provider.value" @update:model-value="emit('provider-change', $event)"><option v-for="option in view.provider.options" :key="option.value" :value="option.value">{{ option.label }}</option></UiSelect>
</label>
<button v-if="view.panel" id="gev-voice-settings-button" class="gev-voice-settings-button" type="button" :aria-label="t('Voice Settings')" aria-controls="gev-voice-panel" :aria-expanded="String(view.voicePanel.settingsExpanded)" @click="emit('settings-button')"><span class="material-symbols-outlined gev-voice-settings-icon" aria-hidden="true">settings</span></button>
<div class="gev-voice-heading">
<div class="gev-voice-kicker">{{ t('AI AGENT') }}</div>
<div id="gev-voice-status">{{ view.status.text }}</div>
<span v-if="view.panel" id="gev-voice-cost-warning" class="gev-voice-cost-value gev-voice-cost-warning" :hidden="view.costWarning.hidden" :title="optional(view.costWarning.title)" :data-level="optional(view.costWarning.level)" role="status" aria-live="polite">{{ view.costWarning.text }}</span>
<div v-else class="gev-voice-cost">
<UiButton id="gev-voice-tier" class="gev-voice-tier-btn" :hidden="view.tier.hidden" :pressed="Boolean(view.tier.pressed)" :title="view.tier.title" @click="emit('tier')">{{ view.tier.text }}</UiButton>
<span id="gev-voice-cost-value" class="gev-voice-cost-value" :hidden="view.cost.hidden" :data-level="view.cost.level" :title="view.cost.title">{{ view.cost.text }}</span>
</div>
</div>
<UiButton id="gev-voice-button" :aria-label="view.button.label" :pressed="view.button.pressed ?? undefined" aria-describedby="gev-voice-help" @click="emit('button')">
<span class="gev-mic-orbit"><img src="/mic.svg" alt="" /></span>
<span class="gev-mic-label">{{ view.mic.text }}</span>
</UiButton>
<VoiceVisualizer />
<div class="gev-voice-readout">
<div id="gev-voice-detail" :title="optional(view.detail.title)">{{ view.detail.text }}</div>
</div>
<div id="gev-voice-help" class="gev-voice-help-tray" role="tooltip">
<span class="gev-voice-help-kicker">{{ t('VOICE CONTROL') }}</span>
<span class="gev-voice-help-detail">{{ view.help.text }}</span>
</div>
<section v-if="view.panel" id="gev-voice-panel" class="gev-voice-panel" :hidden="view.voicePanel.hidden" :data-view="optional(view.voicePanel.view)" :aria-label="t('Voice Settings')" @keydown="emit('panel-keydown', $event)">
<div class="gev-voice-panel-header">
<span class="gev-voice-panel-title">{{ t('VOICE') }}</span>
<div class="gev-voice-panel-tabs" role="tablist" :aria-label="t('Voice Settings')">
<button id="gev-voice-preview-tab" class="gev-voice-panel-tab" type="button" role="tab" :aria-label="t('Preview')" :title="t('Preview')" :aria-selected="String(view.voicePanel.selected === 'preview')" :tabindex="view.voicePanel.selected === 'preview' ? 0 : -1" aria-controls="gev-voice-preview-panel" @click="emit('tab', 0)" @keydown="emit('tab-keydown', 0, $event)"><span class="material-symbols-outlined gev-voice-panel-tab-icon" aria-hidden="true">visibility</span></button>
<button id="gev-voice-settings-tab" class="gev-voice-panel-tab" type="button" role="tab" :aria-label="t('Settings')" :title="t('Settings')" :aria-selected="String(view.voicePanel.selected === 'settings')" :tabindex="view.voicePanel.selected === 'settings' ? 0 : -1" aria-controls="gev-voice-settings-panel" @click="emit('tab', 1)" @keydown="emit('tab-keydown', 1, $event)"><span class="material-symbols-outlined gev-voice-panel-tab-icon" aria-hidden="true">settings</span></button>
</div>
<button id="gev-voice-settings-close" type="button" :aria-label="t('Close voice panel')" @click="emit('settings-close')">×</button>
</div>
<div class="gev-voice-panel-body ui-scroll">
<section id="gev-voice-preview-panel" role="tabpanel" aria-labelledby="gev-voice-preview-tab" :hidden="view.voicePanel.previewHidden">
<p id="gev-voice-preview-empty" :hidden="view.previewEmpty.hidden">{{ view.previewEmpty.text }}</p>
<VoiceCard :card="view.card" @dismiss="emit('card-dismiss')" />
</section>
<section id="gev-voice-settings-panel" role="tabpanel" aria-labelledby="gev-voice-settings-tab" :hidden="view.voicePanel.settingsHidden">
<label class="gev-voice-preference gev-voice-preference-toggle"><input id="gev-voice-preview-enabled" type="checkbox" aria-describedby="gev-voice-preview-note" v-checked="view.preferences.previewChecked" @change="emit('preview-change', $event.target.checked)" /><span>{{ t('Show Voice Preview') }}</span></label>
<p id="gev-voice-preview-note" class="gev-voice-settings-note">{{ view.preferences.previewNote }}</p>
<div class="gev-voice-timeout-group">
<label class="gev-voice-preference gev-voice-setting-title" for="gev-voice-timeout-select">{{ t('Voice inactivity timeout') }}</label>
<div class="gev-voice-timeout-controls">
<UiSelect id="gev-voice-timeout-select" class="gev-field" aria-describedby="gev-voice-timeout-note gev-voice-timeout-status" :model-value="view.preferences.timeoutChoice" @update:model-value="emit('timeout-select', $event)">
<option value="3">{{ minutesLabel(3) }}</option><option value="5">{{ minutesLabel(5) }}</option><option value="10">{{ minutesLabel(10) }}</option><option value="15">{{ minutesLabel(15) }}</option>
<option value="custom">{{ t('Custom') }}</option><option value="0">{{ t('None') }}</option>
</UiSelect>
<label class="gev-voice-timeout-unit" for="gev-voice-timeout-input">{{ t('Minutes') }}</label>
<input id="gev-voice-timeout-input" type="number" min="1" max="60" step="1" aria-describedby="gev-voice-timeout-note" v-owned-value="{ text: view.preferences.timeoutMinutes, revision: view.preferences.revision }" :hidden="view.preferences.timeoutInputHidden" @change="emit('timeout-input', $event.target.value)" />
</div>
<p id="gev-voice-timeout-note" class="gev-voice-settings-note">{{ view.preferences.timeoutNote }}</p>
<p id="gev-voice-timeout-status" class="gev-voice-settings-note" role="status" aria-live="polite">{{ view.preferences.timeoutStatus }}</p>
</div>
<div class="gev-voice-cost-settings">
<div class="gev-voice-cost-setting-row">
<span>{{ t('Voice model tier — applies next session') }}</span>
<UiButton id="gev-voice-tier" class="gev-voice-tier-btn" :hidden="view.tier.hidden" :pressed="Boolean(view.tier.pressed)" :title="view.tier.title" @click="emit('tier')">{{ view.tier.text }}</UiButton>
</div>
<div class="gev-voice-cost-setting-row">
<span>{{ t('Estimated session cost') }}</span>
<span id="gev-voice-cost-value" class="gev-voice-cost-value" :hidden="view.cost.hidden" :data-level="view.cost.level" :title="view.cost.title">{{ view.cost.text }}</span>
</div>
</div>
</section>
</div>
</section>
<VoiceCard v-else :card="view.card" @dismiss="emit('card-dismiss')" />
<div class="gev-voice-error-tray" role="alert" aria-live="assertive">
<div class="gev-voice-error-header">
<span>{{ t('VOICE SYSTEM ERROR') }}</span>
<button class="gev-voice-error-dismiss" type="button" @click="controls?.dismissError()">{{ t('DISMISS') }}</button>
</div>
<div id="gev-voice-error-detail">{{ view.error.text }}</div>
<div class="gev-voice-error-hint">{{ t('Check microphone permission and network access, then try again.') }}</div>
</div>
</div>
</template>