mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +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]>
52 lines
1.7 KiB
JavaScript
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');
|
|
});
|