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,4 +1,5 @@
|
||||
import { displayedKinematics } from '../../data/motionModel.js';
|
||||
import { t } from '../../i18n/index.js';
|
||||
import * as Cesium from 'cesium';
|
||||
import { isExplicitLayerStateOrigin } from '../../data/layerState.js';
|
||||
import { aircraftIncludedInNearby } from '../../data/aircraftNearbyPolicy.js';
|
||||
@@ -54,7 +55,7 @@ export function createQueries({
|
||||
*/
|
||||
|
||||
function _formatAltitude(altitudeFt) {
|
||||
if (!Number.isFinite(altitudeFt)) return 'Alt unknown';
|
||||
if (!Number.isFinite(altitudeFt)) return t('layers.readout.altUnknown');
|
||||
return `${Math.round(altitudeFt)} ft`;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as Cesium from 'cesium';
|
||||
import { t } from '../../i18n/index.js';
|
||||
import { nextCockpitNearContacts } from '../../data/cockpitAirLod.js';
|
||||
import { aircraftIcon, TRACKED_ICON_PX } from '../../data/aircraftIcons.js';
|
||||
import { trackedModelZoomActive } from '../../data/trackedModelRegime.js';
|
||||
@@ -219,7 +220,7 @@ export function createTracking({
|
||||
function _buildTrackedLabel(info, icao24) {
|
||||
const stale =
|
||||
flightState.records.missingPolls.get(icao24) || flightState.feed._backoff
|
||||
? ' · STALE'
|
||||
? ` · ${t('layers.status.stale')}`
|
||||
: '';
|
||||
const callsign =
|
||||
(parts.queries._toCleanText(info?.callsign) ||
|
||||
@@ -229,12 +230,14 @@ export function createTracking({
|
||||
// what the Easter egg replaces the real type with.
|
||||
const type = tr3bTypeLabel(
|
||||
icao24,
|
||||
parts.queries._toCleanText(info?.type) || 'Type unknown',
|
||||
parts.queries._toCleanText(info?.type) || t('layers.readout.typeUnknown'),
|
||||
);
|
||||
const registration =
|
||||
parts.queries._toCleanText(info?.registration) || 'Reg unknown';
|
||||
parts.queries._toCleanText(info?.registration) ||
|
||||
t('layers.readout.regUnknown');
|
||||
const operator =
|
||||
parts.queries._toCleanText(info?.operator) || 'Operator unknown';
|
||||
parts.queries._toCleanText(info?.operator) ||
|
||||
t('layers.readout.operatorUnknown');
|
||||
const altitude = parts.queries._formatAltitude(info?.altitudeFt);
|
||||
const speedKt = info?.speedMps ? Math.round(info.speedMps * 1.944) : null;
|
||||
const tail = speedKt ? `${altitude} · ${speedKt} kt` : altitude;
|
||||
|
||||
Reference in new issue
Block a user