mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
- 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]>
37 lines
1.0 KiB
JavaScript
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(', ')}`,
|
|
);
|
|
});
|
|
}
|