i18n: fix the repeat-review findings

- Status pieces translate in one place (src/ui/statusText.js): a Local
  ADS-B error with a single piece now translates, and the analyst card
  splits empty-layer notes into pieces (Transit, Local ADS-B).
- Translate the ALPR retry chip text, the ECCC error on the Air quality
  card, "Upstream response too large" and the "entry {n}" feed label.
- The unmarked-text check also sees error/loadingLabel/statusMessage/
  status assignments, `status:` properties and showToast?.( /
  this._showToast( calls; the scene import preview marks its pack
  statuses, data and model-facing text carry i18n-ignore with a reason.
- Tests check the real code: the HUD locality formatter moves to
  src/hudLocalityFormat.js, the unsaved-keys test pins the teardown.
- One copy each: city names come from src/cityPois.js, the GNSS HTTP
  template and wind "field unavailable" texts; dead fallbacks removed.
- Leftovers of the reverted vessel-label change and the reformatting of
  detectionHost.test.mjs / keySetup.test.mjs are back to main.

Catalogs: es/ru 2617 messages each, complete.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
German KhokhlovandClaude Opus 5.5 committed 2026-10-16 19:28:59 +04:00
1 parent a2463ca2d2
commit 3157888780
60 files changed
+1577 -1606

No files matched your search

+20 -1
View File
@@ -6,6 +6,8 @@ import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { composeLocalityTag, NEAR_POI_MAX_KM } from './hudLocality.js';
import { LOCALIZED_LOCALITY } from './hudLocalityFormat.js';
import { setLocale } from './i18n/index.js';
const ALCATRAZ = { poi: 'Alcatraz Island', city: 'San Francisco' };
const LINCOLN = { poi: 'Lincoln Memorial', city: 'Washington DC' };
@@ -123,7 +125,7 @@ test('a missing or malformed nearest POI never crashes the summary', () => {
});
// The names reach a formatter as catalogued, so the HUD can translate the
// city before upper-casing it (N-04: `TOKYO` never matched the `Tokyo` key).
// city before upper-casing it: the place-name table knows `Tokyo`, not `TOKYO`.
test('a formatter builds the line from the same parts', () => {
const format = {
near: ({ poi, city, distKm }) => `near:${poi}|${city}|${distKm}`,
@@ -138,3 +140,20 @@ test('a formatter builds the line from the same parts', () => {
'sector:21.3|-157.8',
);
});
test('the HUD formatter translates the catalogued city, then upper-cases it', () => {
const tokyo = { poi: 'Tokyo Tower', city: 'Tokyo', distKm: 2 };
assert.equal(
composeLocalityTag(tokyo, 35.66, 139.75, LOCALIZED_LOCALITY),
'NEAR TOKYO TOWER (TOKYO) 2KM',
);
setLocale('ru');
try {
assert.match(
composeLocalityTag(tokyo, 35.66, 139.75, LOCALIZED_LOCALITY),
/\(ТОКИО\)/,
);
} finally {
setLocale('en');
}
});