mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
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:
1 parent
bde1e430ef
commit
284c4d4601
98 files changed
+3474
-1625
No files matched your search
+14
-4
@@ -10,7 +10,8 @@
|
||||
// state is re-synced from controller state (never optimistically), so a failed
|
||||
// or superseded switch still leaves the truly-active stack lit.
|
||||
|
||||
import { keySetupRequirement } from './keySetupCore.mjs';
|
||||
import { keySetupRequirementEnvVars } from './keySetupCore.mjs';
|
||||
import { t } from './i18n/index.js';
|
||||
|
||||
export const MAP_STACK_CHIP_CLASS = 'map-stack-chip';
|
||||
export const PRESENTED_MAP_STACK_IDS = Object.freeze([
|
||||
@@ -37,9 +38,15 @@ export function mapStackChipModel(stack, activeId) {
|
||||
const available = stack?.available !== false;
|
||||
const label = String(stack?.label ?? stack?.id ?? '');
|
||||
const requiresIon = stack?.requiresIon === true;
|
||||
// Stack labels are provider/dataset names (keep-English); the availability
|
||||
// sentence around them is copy and localizes here at the model boundary.
|
||||
const fallbackReason = requiresIon
|
||||
? keySetupRequirement('cesium-ion')
|
||||
: `${label || 'This map stack'} is unavailable`;
|
||||
? t('setup.keySetup.requirement', {
|
||||
envVars: keySetupRequirementEnvVars('cesium-ion'),
|
||||
})
|
||||
: t('setup.mapStack.unavailableReason', {
|
||||
label: label || t('setup.mapStack.fallbackName'),
|
||||
});
|
||||
const unavailableHint = available
|
||||
? ''
|
||||
: String(stack?.unavailableReason || fallbackReason);
|
||||
@@ -119,7 +126,10 @@ export function renderMapStackChips(
|
||||
if (!model.available) {
|
||||
chip.setAttribute(
|
||||
'aria-label',
|
||||
`${model.label} unavailable: ${model.unavailableHint}`,
|
||||
t('setup.mapStack.unavailableAriaLabel', {
|
||||
label: model.label,
|
||||
hint: model.unavailableHint,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user