fix(i18n): eager-load nl bundle, fix language selector, remove hardcoded backend messages
- Eager-load both en and nl translation bundles at i18n init to eliminate
the async gap that caused English flash when Dutch was the detected language
- LanguageSwitcher: use i18n.language (synchronous) instead of resolvedLanguage
(asynchronous) so the visual selection is always correct after switching
- AvailabilityController: remove hardcoded English messages ("System is running
normally.") from GET /availability/status; return empty string so the frontend
translations control the display text
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,13 @@ import {
|
||||
/** Language selector for the topbar; lazy-loads the chosen locale (Q4-B). */
|
||||
export function LanguageSwitcher() {
|
||||
const { t, i18n } = useTranslation();
|
||||
const current = (i18n.resolvedLanguage ?? 'en') as SupportedLanguage;
|
||||
// Use i18n.language (set synchronously on change) rather than resolvedLanguage
|
||||
// (which can lag when bundles were lazy-loaded). Split on '-' to normalise
|
||||
// region variants like 'nl-NL' → 'nl'.
|
||||
const rawLang = i18n.language?.split('-')[0] ?? 'en';
|
||||
const current = (SUPPORTED_LANGUAGES.includes(rawLang as SupportedLanguage)
|
||||
? rawLang
|
||||
: 'en') as SupportedLanguage;
|
||||
|
||||
return (
|
||||
<DropdownMenu>
|
||||
|
||||
Reference in New Issue
Block a user