mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 18:34:02 +00:00
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:
1 parent
a2463ca2d2
commit
3157888780
60 files changed
+1577
-1606
No files matched your search
@@ -5,7 +5,13 @@
|
||||
// catalog entry, not only the default one.
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { setLocale } from '../i18n/index.js';
|
||||
import { setLocale, t } from '../i18n/index.js';
|
||||
import {
|
||||
aggregateLayerLoading,
|
||||
createLoadingFeedbackState,
|
||||
presentLoadingFeedback,
|
||||
reduceLoadingFeedback,
|
||||
} from '../loadingFeedback.js';
|
||||
|
||||
const elements = {
|
||||
'global-loading-status': { hidden: true, dataset: {} },
|
||||
@@ -107,4 +113,30 @@ for (const locale of ['es', 'ru']) {
|
||||
assert.equal(localized.label, 'HTTP 503 FROM OVERPASS-API.DE');
|
||||
assert.notEqual(localized.detail, 'retry pending');
|
||||
});
|
||||
|
||||
// An incomplete Overpass answer (alpr/source.js) on the ALPR retry chip,
|
||||
// which shows the layer's error upper-cased.
|
||||
test(`${locale}: the ALPR retry chip translates an incomplete Overpass answer`, () => {
|
||||
setLocale(locale);
|
||||
const error = 'Overpass returned an incomplete camera response';
|
||||
assert.notEqual(t(error), error, 'the catalog has the entry');
|
||||
const now = Date.now();
|
||||
const layer = {
|
||||
id: 'alpr-cameras',
|
||||
name: 'ALPR cameras',
|
||||
enabled: true,
|
||||
stats: { status: 'unavailable', error, retryAt: now + 12000 },
|
||||
};
|
||||
const summary = aggregateLayerLoading([layer]);
|
||||
const state = reduceLoadingFeedback(
|
||||
createLoadingFeedbackState(),
|
||||
summary,
|
||||
now,
|
||||
);
|
||||
const shown = localizeLoadingPresentation(
|
||||
presentLoadingFeedback(state, summary, now),
|
||||
);
|
||||
assert.equal(shown.state, 'retry', 'the ALPR retry chip is up');
|
||||
assert.equal(shown.label, t(error).toLocaleUpperCase(locale));
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user