Files
gods-eye-view/src/ui/localAdsbGuidanceI18n.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

52 lines
1.7 KiB
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
test('Local ADS-B guidance hint is translated in the layer row', async () => {
const { setLocale, t } = await import('../i18n/index.js');
const { LayerPanel } = await import('./layerPanel.js');
const { localAdsbStatus } = await import('../layers/localAdsb/status.js');
const english = localAdsbStatus({
receiver: { webUsbSupported: true, connected: false },
feedState: null,
heard: 0,
});
assert.equal(
LayerPanel.prototype._buildMetaText.call(LayerPanel.prototype, {
id: 'local-adsb',
enabled: true,
lifecycleState: 'enabled',
stats: { count: 0, lastUpdate: null, ...english },
}),
'RTL-SDR · WebUSB · connect a receiver in Radio',
);
for (const locale of ['es', 'ru']) {
setLocale(locale);
for (const receiver of [
{ webUsbSupported: true, connected: false },
{ webUsbSupported: false, connected: false },
{ webUsbSupported: true, connected: true, mode: 'fm' },
]) {
const stats = localAdsbStatus({ receiver, feedState: null, heard: 0 });
const text = LayerPanel.prototype._buildMetaText.call(
LayerPanel.prototype,
{
id: 'local-adsb',
enabled: true,
lifecycleState: 'enabled',
stats: { count: 0, lastUpdate: null, ...stats },
},
);
assert.notEqual(
t(stats.statusMessage),
stats.statusMessage,
`${locale}: no catalog entry for "${stats.statusMessage}"`,
);
assert.ok(
!text.includes(stats.statusMessage),
`${locale}: row shows English hint: ${text}`,
);
}
}
setLocale('en');
});