mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +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
@@ -1,3 +1,4 @@
|
||||
import { t } from '../i18n/index.js';
|
||||
import {
|
||||
readStoredVoiceTier,
|
||||
readStoredVoiceLimits,
|
||||
@@ -50,18 +51,25 @@ export class RealtimeCost {
|
||||
const pendingId = resolveVoiceModel(pendingTier).id;
|
||||
this.ui.tierButton.title =
|
||||
this.isActive() && state.modelId !== pendingId
|
||||
? `Next session: ${pendingId} — this session stays on ${state.modelId}`
|
||||
: `Voice model: ${pendingId} — click to switch to ${
|
||||
isMini ? 'standard' : 'mini'
|
||||
}; applies next session`;
|
||||
? t('setup.voice.tierNextSession', {
|
||||
pendingId,
|
||||
modelId: state.modelId,
|
||||
})
|
||||
: t('setup.voice.tierSwitchHint', {
|
||||
pendingId,
|
||||
target: isMini ? 'standard' : 'mini',
|
||||
});
|
||||
}
|
||||
if (this.ui?.costValue) {
|
||||
this.ui.costValue.textContent = state.display;
|
||||
this.ui.costValue.dataset.level = state.level;
|
||||
this.ui.costValue.title =
|
||||
`Estimated session cost on ${state.modelId} — ${state.responses} response(s). ` +
|
||||
`Warns at ${formatCostUsd(state.warnUsd)}, ends the session at ${formatCostUsd(state.capUsd)}.` +
|
||||
(state.note ? ` ${state.note}` : '');
|
||||
t('setup.voice.costTooltip', {
|
||||
modelId: state.modelId,
|
||||
responses: state.responses,
|
||||
warn: formatCostUsd(state.warnUsd),
|
||||
cap: formatCostUsd(state.capUsd),
|
||||
}) + (state.note ? ` ${state.note}` : '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +112,9 @@ export class RealtimeCost {
|
||||
if (this.isActive() && this.ui?.detail) {
|
||||
this.setStatus(
|
||||
this.status,
|
||||
`${this.voiceTier.toUpperCase()} applies next session`,
|
||||
t('setup.voice.tier.appliesNextSession', {
|
||||
tier: this.voiceTier.toUpperCase(),
|
||||
}),
|
||||
);
|
||||
}
|
||||
return this.voiceTier;
|
||||
@@ -182,7 +192,10 @@ export class RealtimeCost {
|
||||
try {
|
||||
this.stop({ preserveStatus: true });
|
||||
} finally {
|
||||
this.setStatus('idle', `Session ended — cost cap ${state.display}`);
|
||||
this.setStatus(
|
||||
'idle',
|
||||
t('setup.voice.status.sessionCostCap', { cost: state.display }),
|
||||
);
|
||||
this.syncCostUi();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user