mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 11:23:10 +02:00
Handle restricted language configuration fallback V2 (#5154)
## Summary - restrict supported languages to the validated list from app-config instead of always adding an extra fallback - set the effective fallback locale to the preferred configured language and switch away from disallowed selections automatically ## Testing - ./gradlew build ------ [Codex Task](https://chatgpt.com/codex/tasks/task_b_6930529bc6c08328a1ce05f7d1316e27)
This commit is contained in:
@@ -14,8 +14,9 @@ export default function AppConfigLoader() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!loading && config) {
|
||||
// Update supported languages if config specifies a language filter
|
||||
updateSupportedLanguages(config.languages);
|
||||
// Update supported languages and apply default locale from server config
|
||||
// Priority: localStorage > config.defaultLocale > browser detection > fallback
|
||||
updateSupportedLanguages(config.languages, config.defaultLocale);
|
||||
}
|
||||
}, [config, loading]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user