fix(i18n): add French and German to language selector

- Add Français and Deutsch to available languages in settings
- Update language mappings and Auto detection
This commit is contained in:
vicrodh committed 2026-02-02 20:09:15 -06:00
1 parent bdeb436fb8
commit 1e3aa7b0df
1 file changed
+8 -4
+8 -4
View File
@@ -381,16 +381,20 @@
const languageToLocale: Record<string, string | null> = { const languageToLocale: Record<string, string | null> = {
'Auto': null, 'Auto': null,
'English': 'en', 'English': 'en',
'Español': 'es' 'Español': 'es',
'Français': 'fr',
'Deutsch': 'de'
}; };
const localeToLanguage: Record<string, string> = { const localeToLanguage: Record<string, string> = {
'en': 'English', 'en': 'English',
'es': 'Español' 'es': 'Español',
'fr': 'Français',
'de': 'Deutsch'
}; };
// Available languages (only those with translations) // Available languages (only those with translations)
const availableLanguages = ['Auto', 'English', 'Español']; const availableLanguages = ['Auto', 'English', 'Español', 'Français', 'Deutsch'];
// Audio settings // Audio settings
let streamingQuality = $state('Hi-Res+'); let streamingQuality = $state('Hi-Res+');
@@ -1082,7 +1086,7 @@
} else { } else {
// 'Auto' - use browser locale, defaulting to 'en' // 'Auto' - use browser locale, defaulting to 'en'
const browserLocale = navigator.language.split('-')[0]; const browserLocale = navigator.language.split('-')[0];
const supportedLocale = ['en', 'es'].includes(browserLocale) ? browserLocale : 'en'; const supportedLocale = ['en', 'es', 'fr', 'de'].includes(browserLocale) ? browserLocale : 'en';
await setLocale(supportedLocale); await setLocale(supportedLocale);
// Clear the stored locale so it uses browser detection on next load // Clear the stored locale so it uses browser detection on next load
localStorage.removeItem('qbz-locale'); localStorage.removeItem('qbz-locale');