fix(i18n): Street Level errors in the UI language; hint row wraps

The Street Level error line and its toasts showed provider errors as
thrown (Google's key-rejected message stayed English). They go through
translateKnown now. In a translation the coverage hint no longer shrinks
to a narrow column beside OPEN GOOGLE STREET VIEW: the button takes its
own line when both do not fit. English layout is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
German KhokhlovandClaude Opus 5.5 committed 2026-10-13 20:47:00 +04:00
1 parent 8b0bb031b6
commit 9f1e409193
3 files changed
+21 -5

No files matched your search

+5 -4
View File
@@ -5,7 +5,7 @@ import {
SINCE_STOPS,
} from './streetLevelPresentation.js';
import { t } from '../i18n/index.js';
import { t, translateKnown } from '../i18n/index.js';
const RENDER_MODE_KEY = 'gev:street-level:render-mode';
const FOCUSABLE =
'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
@@ -229,7 +229,8 @@ export class StreetLevelControls {
await this.actions.setEnabled?.(true);
} catch (error) {
this.actions.showToast?.(
error?.message || t('Street Level could not start'),
translateKnown(error?.message || '') ||
t('Street Level could not start'),
);
return false;
}
@@ -242,7 +243,7 @@ export class StreetLevelControls {
await this.actions.setEnabled?.(!enabled);
} catch (error) {
this.actions.showToast?.(
error?.message || t('Street Level toggle failed'),
translateKnown(error?.message || '') || t('Street Level toggle failed'),
);
}
}
@@ -276,7 +277,7 @@ export class StreetLevelControls {
await this.actions.setEnabled?.(false);
} catch (error) {
this.actions.showToast?.(
error?.message || t('Street Level toggle failed'),
translateKnown(error?.message || '') || t('Street Level toggle failed'),
);
}
}