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

@@ -1,10 +1,11 @@
// N-09: a scalar overlay that cannot be drawn reports a marked English status
// A scalar overlay that cannot be drawn reports a marked English status
// (rendering.js), which the Wind row shows through t() in the UI language.
import test from 'node:test';
import assert from 'node:assert/strict';
import { setLocale, t } from '../../i18n/index.js';
import { WIND_FIELDS } from './fields.js';
import { fieldUnavailableText } from './rendering.js';
import { SCALAR_UNAVAILABLE } from './source.js';
for (const locale of ['es', 'ru']) {
test(`${locale}: every field's unavailable status has a translation`, () => {
@@ -19,3 +20,10 @@ for (const locale of ['es', 'ru']) {
}
});
}
test('only a known overlay has an unavailable status', () => {
assert.equal(fieldUnavailableText('constructor'), null);
assert.equal(fieldUnavailableText('none'), null);
for (const [overlay, text] of Object.entries(SCALAR_UNAVAILABLE))
assert.equal(fieldUnavailableText(overlay), text);
});
+1
View File
@@ -205,6 +205,7 @@ export function createWindGpuRendering({ cesium: C, getViewer }) {
} catch (error) {
clear();
diagnostics.error =
// i18n-ignore: GPU diagnostics only; the panel never shows this field
error instanceof Error ? error.message : 'Wind geometry unavailable';
return false;
}
+1
View File
@@ -91,6 +91,7 @@ export function createWindLayer({
model: model === 'ifs' ? 'ECMWF' : 'GFS',
validTime:
formatWindValidTime(manifest?.cycle?.validIso) || 'Unavailable',
// i18n-ignore: English reading for AI tools; the card status uses t()
status: loading
? 'Loading forecast'
: error ||
+6 -4
View File
@@ -7,6 +7,7 @@ import { orderWeatherImagery } from '../weather/imageryOrder.js';
import { NO_IMAGERY_HOST } from '../weather/imageryHost.js';
import { msg } from '../../i18n/index.js';
import { createWindGpuRendering } from './gpuRendering.js';
import { SCALAR_UNAVAILABLE } from './source.js';
import { advectParticle, sampleWind } from './model.js';
import {
createFieldRaster,
@@ -16,16 +17,17 @@ import {
// A scalar overlay that cannot be drawn, in English for diagnostics; the
// panel status shows it translated (index.js). The scalar texts are the ones
// the source reports (source.js).
// the source reports. setOptions only accepts these overlays.
const FIELD_UNAVAILABLE = Object.freeze({
speed: msg('Wind speed field unavailable'),
temperature: msg('Temperature field unavailable'),
pressure: msg('Mean sea level pressure field unavailable'),
...SCALAR_UNAVAILABLE,
});
/** English status for a scalar overlay with no drawable field. */
export function fieldUnavailableText(overlay) {
return FIELD_UNAVAILABLE[overlay] || `${overlay} field unavailable`;
return Object.hasOwn(FIELD_UNAVAILABLE, overlay)
? FIELD_UNAVAILABLE[overlay]
: null;
}
const WIND_FIELD_FADE_HIGH_METERS = 1_200_000;
const WIND_FIELD_FADE_LOW_METERS = 200_000;
+7 -4
View File
@@ -4,6 +4,12 @@ import { readWindBody } from '../../sources/windBody.js';
// wind layer and layer panel show them translated.
const msg = (text) => text;
/** Status of a scalar overlay the provider could not supply, by overlay. */
export const SCALAR_UNAVAILABLE = Object.freeze({
temperature: msg('Temperature field unavailable'),
pressure: msg('Mean sea level pressure field unavailable'),
});
/** Create a bounded, cancellable source for the same-origin wind provider. */
export function createWindSource({
fetchImpl = (...args) => globalThis.fetch(...args),
@@ -44,10 +50,7 @@ export function createWindSource({
const optionalUnavailable =
overlay !== 'none' &&
scalar === undefined &&
scalarError ===
(overlay === 'temperature'
? msg('Temperature field unavailable')
: msg('Mean sea level pressure field unavailable'));
scalarError === SCALAR_UNAVAILABLE[overlay];
const scalarValid =
overlay === 'none'
? scalar === undefined && scalarError === undefined