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

+16 -11
View File
@@ -1,4 +1,5 @@
import * as Cesium from 'cesium';
import { t } from '../../i18n/index.js';
import {
REPLAY_ASCENT_FALLBACK_SEC,
REPLAY_ASCENT_MIN_SEC,
@@ -200,10 +201,10 @@ export function createReplay({ state: layerState, services, parts, source }) {
if (speedControl) speedControl.hidden = !replayAvailable;
button.hidden = active || !replayAvailable;
button.disabled = !replayAvailable;
button.textContent = 'REPLAY ASCENT';
button.textContent = t('layers.missions.replay.start');
button.classList.remove('active');
button.setAttribute('aria-pressed', String(active));
button.title = 'Replay the estimated ascent with a following camera';
button.title = t('layers.missions.replay.startTitle');
if (transport) {
transport.hidden = !active;
transport.classList.toggle(
@@ -218,11 +219,13 @@ export function createReplay({ state: layerState, services, parts, source }) {
toggleButton.textContent = layerState._replayPaused ? '▶' : 'Ⅱ';
toggleButton.setAttribute(
'aria-label',
layerState._replayPaused ? 'Resume replay' : 'Pause replay',
layerState._replayPaused
? t('layers.missions.replay.resume')
: t('layers.missions.replay.pause'),
);
toggleButton.title = layerState._replayPaused
? 'Resume replay'
: 'Pause replay';
? t('layers.missions.replay.resume')
: t('layers.missions.replay.pause');
}
}
}
@@ -233,17 +236,19 @@ export function createReplay({ state: layerState, services, parts, source }) {
);
if (!transport || !layerState._replayCameraLaunchId) return;
const phase = state.countdownActive
? `T minus ${state.countdownSeconds}`
? t('layers.missions.replay.phaseCountdown', {
seconds: state.countdownSeconds,
})
: state.preCountdownActive
? 'Preparing launch site'
? t('layers.missions.replay.phasePreparing')
: state.elapsedSinceStart < 1
? 'Liftoff'
? t('layers.missions.replay.phaseLiftoff')
: state.ascending
? 'Ascent replay'
: 'Orbit replay';
? t('layers.missions.replay.phaseAscent')
: t('layers.missions.replay.phaseOrbit');
transport.setAttribute(
'aria-label',
`${phase}${layerState._replayPaused ? ', paused' : ''}`,
`${phase}${layerState._replayPaused ? t('layers.missions.replay.pausedSuffix') : ''}`,
);
}