pub fn initialize_locale_system(
app: &mut AppState,
locale_pref: &str,
_prefs: &Settings,
)Expand description
What: Initialize the locale system: resolve locale, load translations, set up fallbacks.
Inputs:
app: Application state to populate with locale and translationslocale_pref: Locale preference fromsettings.conf(empty = auto-detect)_prefs: Settings struct (unused but kept for future use)
Output:
- Populates
app.locale,app.translations, andapp.translations_fallback
Details:
- Resolves locale using fallback chain (settings -> system -> default)
- Loads English fallback translations first (required)
- Loads primary locale translations if different from English
- Handles errors gracefully: falls back to English if locale file missing/invalid
- Logs warnings for missing files but continues execution