mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
Apply the accepted findings from the third three-model French review:
tool-name agreement (« Outil actif : {name} »), elision before ADS-B,
« GORGE AVAL », « CLASSIQUES », « EN SURVOL », one name for the VIIRS
daily overview, U+202F thousands separator, and wording fixes for the
scene editor, directions, radio tuner and status strings.
The CCTV HUD summary now shows its CAL badge, source kind and view band
through existing catalog entries, so French reads « CAL ESTIM. INITIALE ·
SRC AMONT · CONTEXTE RUE »; English output and unknown codes are
unchanged. presentation.js matches the pt branch's round-3 version byte
for byte, so the two branches merge cleanly.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
59 lines
1.7 KiB
JavaScript
59 lines
1.7 KiB
JavaScript
// The CCTV HUD summary shows the CAL badge, source kind and view band in the
|
|
// UI language; English keeps its codes, and unknown source codes stay codes.
|
|
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { setLocale } from '../../i18n/index.js';
|
|
import { createPresentation } from './presentation.js';
|
|
|
|
function summary(sourceKind) {
|
|
const camera = {
|
|
id: 'c1',
|
|
city: 'Austin',
|
|
name: 'Cam',
|
|
rangeM: 100,
|
|
fovDeg: 60,
|
|
feedType: 'image',
|
|
};
|
|
const record = { camera };
|
|
const presentation = createPresentation({
|
|
state: {
|
|
_records: [record],
|
|
_healthById: new Map(sourceKind ? [['c1', { sourceKind }]] : []),
|
|
_showProjection: false,
|
|
_coverageMode: 'sector',
|
|
},
|
|
services: {},
|
|
parts: {
|
|
selection: { getActiveRecord: () => record },
|
|
model: {
|
|
sectorAreaKm2: () => 1,
|
|
currentViewContext: () => 'street:1:2',
|
|
},
|
|
geometry: { coverageNeighborCount: () => 0 },
|
|
calibration: { deriveCalBadge: () => 'raw-prior' },
|
|
},
|
|
source: {},
|
|
});
|
|
return presentation.buildSummaryText();
|
|
}
|
|
|
|
test('en: CAL, SRC and CONTEXT keep their English codes', () => {
|
|
setLocale('en');
|
|
assert.match(summary('upstream'), /CAL RAW PRIOR · SRC UPSTREAM/);
|
|
assert.match(summary(null), /SRC IMAGE · STREET CONTEXT/);
|
|
assert.match(summary('upstream-image'), /SRC UPSTREAM-IMAGE/);
|
|
});
|
|
|
|
test('fr: CAL, SRC and CONTEXT values are translated', () => {
|
|
setLocale('fr');
|
|
try {
|
|
assert.match(
|
|
summary('upstream'),
|
|
/CAL ESTIM\. INITIALE · SRC AMONT · CONTEXTE RUE/,
|
|
);
|
|
assert.match(summary('upstream-image'), /SRC UPSTREAM-IMAGE/);
|
|
} finally {
|
|
setLocale('en');
|
|
}
|
|
});
|