mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 08:42:21 +00:00
i18n: fix review findings and polish ru/es strings
Fixes the 51 P0–P2 findings from the full review of the i18n branch and the issues found while checking every new string on screen in ru and es. - Translate errors and statuses that still reached ru/es in English: feed and tile errors, provider statuses, the ALPR chip, the traffic mode chip, voice plan step labels, fire feed values, receiver bands, scene save reasons and the Cesium attribution link. - Show preset city names in the UI language (src/ui/placeNames.js); data and everything sent to the model stay English. - Share layer names between the layer panel, HUD and voice card (src/ui/layerNames.js). - Keep long ru/es strings whole: voice card error lines, analyst titles, the voice tier status, the Nepal evidence button, the ALPR retry chip. English layout is unchanged. - Ask before a language switch drops unsaved work. - Catalog fixes: glossary terms (пуск, пресет), gender agreement and consistent "peticiones" in es, fewer calques in both languages. - Fix English text that was itself wrong (e.g. "Exit cockpit to fly to a weather", raw tool ids in voice plan steps). Catalogs: es/ru 2535 messages each, complete. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
8029747b7e
commit
00704ddc89
212 files changed
+9871
-909
No files matched your search
@@ -0,0 +1,100 @@
|
||||
// K-37: the Local ADS-B click card follows the UI language; English keeps its
|
||||
// wording (index.test.mjs pins the full English card).
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { setLocale } from '../../i18n/index.js';
|
||||
import { localAdsbCardModel, localAdsbSourceText } from './card.js';
|
||||
|
||||
const record = {
|
||||
icao: 'abc123',
|
||||
callsign: '',
|
||||
altitudeFt: 12500,
|
||||
groundSpeedKt: 240,
|
||||
trackDeg: 90,
|
||||
verticalRateFpm: -1200,
|
||||
lastPositionAt: 1000,
|
||||
messageCount: 48,
|
||||
bands: ['1090'],
|
||||
sources: ['webusb', 'feed'],
|
||||
};
|
||||
|
||||
test('en: the local ADS-B card keeps its English wording', () => {
|
||||
setLocale('en');
|
||||
assert.deepEqual(localAdsbCardModel(record, 5000).details, [
|
||||
'ICAO ABC123 · NO CALLSIGN',
|
||||
'ALT 12,500 FT · GS 240 KT · TRK 90°',
|
||||
'V/S -1,200 FPM',
|
||||
'POSITION 4 S AGO · 48 MSGS',
|
||||
'Heard by your receiver · 1090 MHz · browser SDR + decoder feed',
|
||||
]);
|
||||
assert.equal(
|
||||
localAdsbSourceText(record),
|
||||
'Your RTL-SDR receiver and decoder feed',
|
||||
);
|
||||
});
|
||||
|
||||
for (const locale of ['es', 'ru']) {
|
||||
test(`${locale}: the local ADS-B card is in the UI language`, () => {
|
||||
setLocale(locale);
|
||||
try {
|
||||
const text = [
|
||||
...localAdsbCardModel(record, 5000).details,
|
||||
localAdsbSourceText(record),
|
||||
].join(' | ');
|
||||
for (const english of [
|
||||
'NO CALLSIGN',
|
||||
'GS ',
|
||||
'POSITION',
|
||||
'AGO',
|
||||
'MSGS',
|
||||
'Heard by',
|
||||
'browser SDR',
|
||||
'decoder feed',
|
||||
'Your RTL-SDR',
|
||||
'12,500',
|
||||
])
|
||||
assert.ok(
|
||||
!text.includes(english),
|
||||
`${locale}: "${english}" in ${text}`,
|
||||
);
|
||||
} finally {
|
||||
setLocale('en');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
test('the class line names the aircraft class in the UI language', async () => {
|
||||
const { localAdsbClassLine } = await import('./card.js');
|
||||
const { AIRCRAFT_CLASS_LABELS } = await import('../../data/aircraftClass.js');
|
||||
const heli = { category: 'A7' };
|
||||
try {
|
||||
setLocale('en');
|
||||
assert.equal(
|
||||
localAdsbClassLine(heli, { klass: 'helicopter', evidence: true }),
|
||||
'Helicopter · A7',
|
||||
);
|
||||
for (const locale of ['es', 'ru']) {
|
||||
setLocale(locale);
|
||||
for (const [klass, label] of Object.entries(AIRCRAFT_CLASS_LABELS)) {
|
||||
const line = localAdsbClassLine({}, { klass, evidence: true });
|
||||
assert.ok(line, `${locale}: ${klass} has a class line`);
|
||||
assert.notEqual(line, label, `${locale}: "${label}" is in English`);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
setLocale('en');
|
||||
}
|
||||
});
|
||||
|
||||
// C8: the receiver bands follow the UI language too ("1090 МГц").
|
||||
test('ru: the receiver line names the bands in Russian', async () => {
|
||||
const { localAdsbReceiverLine } = await import('./card.js');
|
||||
setLocale('ru');
|
||||
try {
|
||||
const line = localAdsbReceiverLine({ ...record, bands: ['1090', '978'] });
|
||||
assert.match(line, /· 1090 МГц \+ 978 МГц UAT ·/);
|
||||
assert.doesNotMatch(line, /MHz/);
|
||||
} finally {
|
||||
setLocale('en');
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user