fix(i18n): toast, boot labels and AI tool text found in review

- The Space Missions cancellation failure toast read "[object Object]" in
  every language: the options object was passed as the message. The English
  message is the second argument again, the translation the third.
- Header text is translated before panel chrome builds its collapse labels,
  so the dock and display toggles no longer read "Expand VISUAL PRESETS" in
  another language.
- The voice "show data layers" result keeps the English layer name
  (row data-layer-name), not the translated row text.
- The Google 3D unavailable reason is translated in full.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
German KhokhlovandClaude Opus 5.5 committed 2026-10-13 20:07:09 +04:00
1 parent 9d01f9bfcd
commit 0c647a791b
7 files changed
+27 -6

No files matched your search

+3 -1
View File
@@ -2028,5 +2028,7 @@
"{duration}s + {hold}s": "{duration} s + {hold} s", "{duration}s + {hold}s": "{duration} s + {hold} s",
"Configured Source": "Fuente configurada", "Configured Source": "Fuente configurada",
"subject": "sujeto", "subject": "sujeto",
"{value}m": "{value} m" "{value}m": "{value} m",
"Google 3D tiles unavailable — check the key's API restrictions, quota, or network": "Teselas de Google 3D no disponibles: revisa las restricciones de API de la clave, la cuota o la red",
"Needs {envVars} — add it in Provider Settings — or a Cesium ion token for the ion-hosted route": "Necesita {envVars} — añádela en Ajustes de proveedores — o un token de Cesium ion para la ruta alojada en ion"
} }
+3 -1
View File
@@ -2060,5 +2060,7 @@
"{duration}s + {hold}s": "{duration} с + {hold} с", "{duration}s + {hold}s": "{duration} с + {hold} с",
"Configured Source": "Настроенный источник", "Configured Source": "Настроенный источник",
"subject": "объект", "subject": "объект",
"{value}m": "{value} м" "{value}m": "{value} м",
"Google 3D tiles unavailable — check the key's API restrictions, quota, or network": "Тайлы Google 3D недоступны — проверьте ограничения API ключа, квоту или сеть",
"Needs {envVars} — add it in Provider Settings — or a Cesium ion token for the ion-hosted route": "Нужен {envVars} — добавьте его в «Настройках провайдеров» — или токен Cesium ion для маршрута через ion"
} }
+7 -2
View File
@@ -14,7 +14,12 @@ import { t } from '../i18n/index.js';
*/ */
export function photorealUnavailableReason(hasCredentials) { export function photorealUnavailableReason(hasCredentials) {
if (hasCredentials) if (hasCredentials)
return "Google 3D tiles unavailable — check the key's API restrictions, quota, or network"; return t(
"Google 3D tiles unavailable — check the key's API restrictions, quota, or network",
);
const envVars = keySetupRequirementEnvVars('google-maps'); const envVars = keySetupRequirementEnvVars('google-maps');
return `${t('Needs {envVars} — add it in Provider Settings', { envVars })} — or a Cesium ion token for the ion-hosted route`; return t(
'Needs {envVars} — add it in Provider Settings — or a Cesium ion token for the ion-hosted route',
{ envVars },
);
} }
+2 -1
View File
@@ -569,10 +569,11 @@ export class StyleManager extends ShellFacade {
}); });
this._initUI(); this._initUI();
this._initMapStackControl(); this._initMapStackControl();
// Headers first: panel chrome builds its toggle labels from them.
this._applyRuntimeStaticHeaderText();
this._initPanelChrome(); this._initPanelChrome();
this._initLocaleSelector(); this._initLocaleSelector();
this._sizeDisplayLabelColumn(); this._sizeDisplayLabelColumn();
this._applyRuntimeStaticHeaderText();
this._initLeftPanelAdaptiveLayout(); this._initLeftPanelAdaptiveLayout();
this._initRightPanelAdaptiveLayout(); this._initRightPanelAdaptiveLayout();
this._initRadioPanel(); this._initRadioPanel();
+1
View File
@@ -69,6 +69,7 @@ export function _handleContextLayerChange(change) {
); );
return true; return true;
}, },
'Space Missions cancellation could not restore the previous layer state', // i18n-ignore: English message; the toast shows localizedMessage
{ {
localizedMessage: t( localizedMessage: t(
'Space Missions cancellation could not restore the previous layer state', 'Space Missions cancellation could not restore the previous layer state',
+6
View File
@@ -129,6 +129,10 @@ const PANEL_LABELS = {
'local-firms': msg('Active Fires'), 'local-firms': msg('Active Fires'),
}; };
function englishPanelLabel(layer) {
return PANEL_LABELS[layer.id] || LAYER_NAME_KEYS[layer.id] || layer.name;
}
// The panel's own English names win, as before i18n; module names otherwise. // The panel's own English names win, as before i18n; module names otherwise.
function panelLabel(layer) { function panelLabel(layer) {
if (PANEL_LABELS[layer.id]) return t(PANEL_LABELS[layer.id]); if (PANEL_LABELS[layer.id]) return t(PANEL_LABELS[layer.id]);
@@ -378,6 +382,8 @@ export class LayerPanel {
const row = document.createElement('div'); const row = document.createElement('div');
row.className = 'data-toggle-row'; row.className = 'data-toggle-row';
row.dataset.layerId = layer.id; row.dataset.layerId = layer.id;
// English name for voice tools, which must not receive translated text.
row.dataset.layerName = englishPanelLabel(layer);
const topRow = document.createElement('div'); const topRow = document.createElement('div');
topRow.className = 'data-toggle-top'; topRow.className = 'data-toggle-top';
+5 -1
View File
@@ -3003,7 +3003,11 @@ function focusDataLayerRow(layerId) {
void row.offsetWidth; void row.offsetWidth;
row.classList.add('gev-voice-focus'); row.classList.add('gev-voice-focus');
window.setTimeout(() => row.classList.remove('gev-voice-focus'), 3000); window.setTimeout(() => row.classList.remove('gev-voice-focus'), 3000);
const name = row.querySelector('.data-name')?.textContent?.trim() || layerId; // The English name: tool results stay English whatever the UI language.
const name =
row.dataset.layerName ||
row.querySelector('.data-name')?.textContent?.trim() ||
layerId;
return { id: layerId, name }; return { id: layerId, name };
} }