Files
gods-eye-view/src/layers/wind/fieldUnavailableLocale.test.mjs
T
German KhokhlovandClaude Opus 5.5 20f4cf3763 i18n: fix the LGTM review findings and tidy the branch texts
- i18n scanner: lastError sink, no false sinks on defaults and ternaries
- shared src/i18n/marker.js for modules that only mark strings
- wind field messages move to wind/fields.js; CITY_POIS imports from cityPois.js
- drop review IDs, change history and stale references from comments and docs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 21:00:28 +04:00

29 lines
1.0 KiB
JavaScript

// 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 { SCALAR_UNAVAILABLE, WIND_FIELDS } from './fields.js';
import { fieldUnavailableText } from './rendering.js';
for (const locale of ['es', 'ru']) {
test(`${locale}: every field's unavailable status has a translation`, () => {
setLocale(locale);
try {
const english = Object.keys(WIND_FIELDS)
.map(fieldUnavailableText)
.filter((text) => t(text) === text);
assert.deepEqual(english, []);
} finally {
setLocale('en');
}
});
}
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);
});