Files
gods-eye-view/src/layers/installations/classLabel.packClasses.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

37 lines
1.0 KiB
JavaScript

// Every class the bundled OSM names pack can put on a record has a
// catalog entry, so the selected card shows it in the UI language.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { setLocale, getCatalog } from '../../i18n/index.js';
import { installationClassLabel } from './classLabel.js';
const pack = JSON.parse(
readFileSync(
new URL(
'../../data/local_data/osm_military_names/names.json',
import.meta.url,
),
'utf8',
),
);
setLocale('en');
const englishLabel = Object.fromEntries(
pack.classes.map((c) => [c, installationClassLabel(c)]),
);
for (const locale of ['es', 'ru']) {
test(`every names-pack class is in the ${locale} catalog`, () => {
const catalog = getCatalog(locale);
const missing = pack.classes.filter(
(c) => catalog[`installation class|${englishLabel[c]}`] === undefined,
);
assert.deepEqual(
missing,
[],
`no ${locale} entry for: ${missing.join(', ')}`,
);
});
}