feat(i18n): presentation extraction — t() call sites, data-i18n templates, locale selector

Route every application-owned presentation string through the i18n
core: t() call sites across the app/layers/ui/data/voice surfaces,
data-i18n* attributes in the src/ui/templates/*.html markup (applied at
boot by applyDocumentTranslations from src/standalone/application.js),
and the dock locale selector (runtime-rendered from the offered pair —
a single EN button while only English ships).

Rebased onto current main, where the extraction follows the module
splits: the shell wiring now lands in the owner modules
(panelChrome, visualSettings, locationNavigation, shareRestoration,
shellFeedback, applicationShell) and the voice status corpus in the
realtime* modules; scene status lives in director.js +
playbackAdapter.js.

Modules shared with the node runtime (loadingFeedback,
installationFeedback, regionalModel, keySetupCore, vessels ingestion)
stay environment-neutral English and localize at their browser render
sites (chip maps in shellFeedback/installations controls, the weather
table in cockpitBriefing, keySetupRequirementEnvVars compositions), so
the package-boundary graph stays clean; the browser boundary groups
now own the i18n modules they reach (scripts/package-boundaries.json).
This commit is contained in:
Meir Michanie committed 2026-10-01 12:41:20 +02:00
1 parent bde1e430ef
commit 284c4d4601
98 files changed
+3474 -1625

No files matched your search

+19 -8
View File
@@ -1,4 +1,5 @@
import { STYLE_STATUS_LABELS } from './visualPresets.js';
import { t } from '../i18n/index.js';
import { UiLifetime } from './uiLifetime.js';
import {
VisualEffects,
@@ -1165,8 +1166,8 @@ export class VisualSettings {
this._celestialBtn.disabled = !styleSupported;
this._celestialBtn.setAttribute('aria-disabled', String(!styleSupported));
this._celestialBtn.title = styleSupported
? 'Celestial ring — reveal the full globe'
: 'Celestial ring — available in Normal style';
? t('cockpit.display.celestialToggleTitle')
: t('cockpit.display.celestialUnavailableTitle');
}
let cameraFocused = false;
if (nextEnabled && focus) {
@@ -1609,21 +1610,31 @@ export class VisualSettings {
btn.setAttribute(
'aria-label',
enabled
? `Detection overlay: ${String(modeLabel).toLowerCase()}`
: 'Detection overlay: off',
? t('cockpit.display.detectionAriaTemplate', {
mode: String(modeLabel).toLowerCase(),
})
: t('cockpit.display.detectionAriaOff'),
);
btn.classList.remove('active', 'god', 'panoptic');
if (modeLabel === 'SPARSE') {
btn.querySelector('.pp-label').textContent = 'SPARSE';
btn.querySelector('.pp-label').textContent = t(
'cockpit.display.detectionLabelSparse',
);
btn.classList.add('active');
} else if (modeLabel === 'BALANCED') {
btn.querySelector('.pp-label').textContent = 'BALANCED';
btn.querySelector('.pp-label').textContent = t(
'cockpit.display.detectionLabelBalanced',
);
btn.classList.add('active');
} else if (modeLabel === 'DENSE') {
btn.querySelector('.pp-label').textContent = 'DENSE';
btn.querySelector('.pp-label').textContent = t(
'cockpit.display.detectionLabelDense',
);
btn.classList.add('active', 'panoptic');
} else {
btn.querySelector('.pp-label').textContent = 'DETECT';
btn.querySelector('.pp-label').textContent = t(
'cockpit.display.detectionLabel',
);
}
if (this._detectionSliderRow) {