mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 07:42:23 +00:00
i18n: fix the repeat-review findings
- Status pieces translate in one place (src/ui/statusText.js): a Local
ADS-B error with a single piece now translates, and the analyst card
splits empty-layer notes into pieces (Transit, Local ADS-B).
- Translate the ALPR retry chip text, the ECCC error on the Air quality
card, "Upstream response too large" and the "entry {n}" feed label.
- The unmarked-text check also sees error/loadingLabel/statusMessage/
status assignments, `status:` properties and showToast?.( /
this._showToast( calls; the scene import preview marks its pack
statuses, data and model-facing text carry i18n-ignore with a reason.
- Tests check the real code: the HUD locality formatter moves to
src/hudLocalityFormat.js, the unsaved-keys test pins the teardown.
- One copy each: city names come from src/cityPois.js, the GNSS HTTP
template and wind "field unavailable" texts; dead fallbacks removed.
- Leftovers of the reverted vessel-label change and the reformatting of
detectionHost.test.mjs / keySetup.test.mjs are back to main.
Catalogs: es/ru 2617 messages each, complete.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
a2463ca2d2
commit
3157888780
60 files changed
+1577
-1606
No files matched your search
@@ -136,3 +136,78 @@ test('unmarkedScript finds literals that reach the page without t/tn/msg', () =>
|
||||
[],
|
||||
);
|
||||
});
|
||||
|
||||
test('unmarkedScript sees toasts behind optional calls and private helpers', () => {
|
||||
const texts = (js) => unmarkedScript('f.js', js).map((f) => f.text);
|
||||
assert.deepEqual(texts("showToast?.('North up');"), ['North up']);
|
||||
assert.deepEqual(texts("this._showToast('Search failed');"), [
|
||||
'Search failed',
|
||||
]);
|
||||
assert.deepEqual(texts("this.showToast('Link copied');"), ['Link copied']);
|
||||
assert.deepEqual(texts("this.actions.showToast?.('Tilted view');"), [
|
||||
'Tilted view',
|
||||
]);
|
||||
assert.deepEqual(texts("showToast?.(t('North up'));"), []);
|
||||
assert.deepEqual(texts("this._showToast(t('Search failed'));"), []);
|
||||
});
|
||||
|
||||
test('unmarkedScript sees status text assigned to layer errors and labels', () => {
|
||||
const texts = (js) => unmarkedScript('f.js', js).map((f) => f.text);
|
||||
assert.deepEqual(texts("layerState._error = 'live feed unavailable';"), [
|
||||
'live feed unavailable',
|
||||
]);
|
||||
assert.deepEqual(
|
||||
texts("this._error = err?.message || 'TeleGeography load failed';"),
|
||||
['TeleGeography load failed'],
|
||||
);
|
||||
assert.deepEqual(texts("_error = 'Route request failed';"), [
|
||||
'Route request failed',
|
||||
]);
|
||||
assert.deepEqual(texts("error ??= 'Feed closed';"), ['Feed closed']);
|
||||
assert.deepEqual(texts('stats.error = `${name} fetch error`;'), [
|
||||
'fetch error',
|
||||
]);
|
||||
assert.deepEqual(texts("loadingLabel = 'loading coverage...';"), [
|
||||
'loading coverage...',
|
||||
]);
|
||||
assert.deepEqual(texts("state._loadingLabel = 'Loading cables';"), [
|
||||
'Loading cables',
|
||||
]);
|
||||
assert.deepEqual(texts("stats.statusMessage = 'Add a key in Settings';"), [
|
||||
'Add a key in Settings',
|
||||
]);
|
||||
assert.deepEqual(texts("this.status = 'Scene not saved';"), [
|
||||
'Scene not saved',
|
||||
]);
|
||||
assert.deepEqual(
|
||||
texts("layerState._error = msg('live feed unavailable');"),
|
||||
[],
|
||||
);
|
||||
assert.deepEqual(texts("stats.error = t('GBFS fetch error');"), []);
|
||||
// Machine values, comparisons and local scratch variables are not UI text.
|
||||
assert.deepEqual(texts("status = 'missing-key';"), []);
|
||||
assert.deepEqual(texts("if (error === 'Feed closed') stop();"), []);
|
||||
assert.deepEqual(texts("const error = log() || 'Unknown shader error';"), []);
|
||||
assert.deepEqual(texts('stats.error = new Error(`HTTP ${code}`);'), []);
|
||||
});
|
||||
|
||||
test('unmarkedScript sees human-readable status, loadingLabel and statusMessage fields', () => {
|
||||
const texts = (js) => unmarkedScript('f.js', js).map((f) => f.text);
|
||||
assert.deepEqual(
|
||||
texts("return { status: 'Scene not saved — storage unavailable' };"),
|
||||
['Scene not saved — storage unavailable'],
|
||||
);
|
||||
assert.deepEqual(
|
||||
texts("return { status: ok ? 'Ready' : 'Source unavailable' };"),
|
||||
['Ready', 'Source unavailable'],
|
||||
);
|
||||
assert.deepEqual(texts("return { loadingLabel: 'Loading feeds' };"), [
|
||||
'Loading feeds',
|
||||
]);
|
||||
assert.deepEqual(texts("return { statusMessage: 'connect a receiver' };"), [
|
||||
'connect a receiver',
|
||||
]);
|
||||
assert.deepEqual(texts("return { status: 'streaming', code: 'ok' };"), []);
|
||||
assert.deepEqual(texts("return { status: 'auth-failed' };"), []);
|
||||
assert.deepEqual(texts("return { status: msg('Source unavailable') };"), []);
|
||||
});
|
||||
@@ -243,6 +243,10 @@ test('tn() shows a caller-formatted count and still picks the form by number', (
|
||||
assert.equal(label(12345), '12,345 map objects');
|
||||
assert.equal(tn(12345, '{count} file', '{count} files'), '12345 files');
|
||||
setLocale('ru');
|
||||
assert.equal(label(12345), '12 345 объектов на карте');
|
||||
assert.equal(label(1), '1 объект на карте');
|
||||
try {
|
||||
assert.equal(label(12345), '12 345 объектов на карте');
|
||||
assert.equal(label(1), '1 объект на карте');
|
||||
} finally {
|
||||
setLocale('en');
|
||||
}
|
||||
});
|
||||
@@ -2440,7 +2440,6 @@
|
||||
"Exit cockpit to fly to a route": "Sal de la cabina para volar a una ruta",
|
||||
"Exit cockpit to fly to a file": "Sal de la cabina para volar a un archivo",
|
||||
"Exit cockpit to fly to a scene": "Sal de la cabina para volar a una escena",
|
||||
"Exit cockpit to fly to a {noun}": "Sal de la cabina para volar a {noun}",
|
||||
"Go to expanded Radio section": "Ir a la sección de Radio expandida",
|
||||
"Expand Radio section in Context": "Expandir la sección de Radio en Contexto",
|
||||
"Double-click the header to snap the panel back": "Haz doble clic en el encabezado para devolver el panel a su sitio",
|
||||
@@ -2877,5 +2876,12 @@
|
||||
"unsaved provider keys": "las claves de proveedores sin guardar",
|
||||
"Exit cockpit to fly to an aircraft": "Sal de la cabina para volar a una aeronave",
|
||||
"Exit cockpit to fly to a satellite": "Sal de la cabina para volar a un satélite",
|
||||
"Exit cockpit to frame contacts": "Sal de la cabina para encuadrar contactos"
|
||||
"Exit cockpit to frame contacts": "Sal de la cabina para encuadrar contactos",
|
||||
"{feed} {count} ({seconds}s old)": "{feed} {count} (hace {seconds} s)",
|
||||
"entry {n}": "n.º {n}",
|
||||
"Upstream response too large": "Respuesta del origen demasiado grande",
|
||||
"Included in bundle": "Incluido en el paquete",
|
||||
"Missing bundle file — reimport its bundle": "Falta el archivo en el paquete — vuelve a importar su paquete",
|
||||
"Source configured; file checked when loaded": "Fuente configurada; el archivo se comprobará al cargarlo",
|
||||
"Source unavailable": "Fuente no disponible"
|
||||
}
|
||||
@@ -2481,7 +2481,6 @@
|
||||
"Exit cockpit to fly to a route": "Выйдите из кабины, чтобы перелететь к маршруту",
|
||||
"Exit cockpit to fly to a file": "Выйдите из кабины, чтобы перелететь к файлу",
|
||||
"Exit cockpit to fly to a scene": "Выйдите из кабины, чтобы перелететь к сцене",
|
||||
"Exit cockpit to fly to a {noun}": "Выйдите из кабины, чтобы перелететь: {noun}",
|
||||
"Go to expanded Radio section": "Перейти к развёрнутому разделу радио",
|
||||
"Expand Radio section in Context": "Развернуть раздел «Радио» в панели «Контекст»",
|
||||
"Double-click the header to snap the panel back": "Двойной щелчок по заголовку — вернуть панель на место",
|
||||
@@ -2944,5 +2943,12 @@
|
||||
"unsaved provider keys": "несохранённые ключи провайдеров",
|
||||
"Exit cockpit to fly to an aircraft": "Выйдите из кабины, чтобы перелететь к самолёту",
|
||||
"Exit cockpit to fly to a satellite": "Выйдите из кабины, чтобы перелететь к спутнику",
|
||||
"Exit cockpit to frame contacts": "Выйдите из кабины, чтобы показать контакты в кадре"
|
||||
"Exit cockpit to frame contacts": "Выйдите из кабины, чтобы показать контакты в кадре",
|
||||
"{feed} {count} ({seconds}s old)": "{feed} {count} ({seconds} с назад)",
|
||||
"entry {n}": "№ {n}",
|
||||
"Upstream response too large": "Слишком большой ответ источника",
|
||||
"Included in bundle": "Входит в архив",
|
||||
"Missing bundle file — reimport its bundle": "Файла нет в архиве — импортируйте этот архив снова",
|
||||
"Source configured; file checked when loaded": "Источник настроен; файл будет проверен при загрузке",
|
||||
"Source unavailable": "Источник недоступен"
|
||||
}
|
||||
Reference in new issue
Block a user