mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-03-28 02:31:17 +01:00
stop enabling english (#5874)
This commit is contained in:
@@ -240,10 +240,11 @@ export function updateSupportedLanguages(configLanguages?: string[] | null, defa
|
||||
i18n.options.supportedLngs = validLanguages;
|
||||
i18n.options.fallbackLng = fallback;
|
||||
|
||||
// If current language is not in the new supported list, switch to fallback
|
||||
// If current language is not in the new supported list, switch to fallback with higher priority to override browser detection
|
||||
const currentLang = normalizeLanguageCode(i18n.language || '');
|
||||
if (currentLang && !validLanguages.includes(currentLang)) {
|
||||
setLanguageWithPriority(fallback, LanguageSource.Fallback);
|
||||
// Use ServerDefault priority to override browser detection when language not in whitelist
|
||||
setLanguageWithPriority(fallback, LanguageSource.ServerDefault);
|
||||
} else if (validDefault) {
|
||||
// Apply server default (respects user choice if already set)
|
||||
setLanguageWithPriority(validDefault, LanguageSource.ServerDefault);
|
||||
|
||||
Reference in New Issue
Block a user