What problem does it solve?
This module removes the complexity of providing multi-language support in Unity projects by centralizing language detection, JSON-based translation loading, fallback handling, and reactive UI updates so games display the correct text and assets consistently across devices and platforms.
Core Features & Use Cases
- Language detection and preferences: automatic detection via PlayerPrefs, Steam language, system language, or a configured default with optional saving of user preference.
- Async JSON loading and flattening: load nested JSON translation files from Resources or Addressables, flatten nested keys to dot notation, and ignore meta sections.
- Dual-dictionary fallback and graceful degradation: maintain current and fallback dictionaries so missing keys fall back to a default language or optional key return behavior.
- Reactive runtime API: observable CurrentLanguage, SetLanguage, PreloadLanguageAsync, UnloadLanguage, GetText (with formatting), TryGetText, HasKey, GetAllKeys, and GetLocalizedAssetPath for language-specific asset naming.
- Integration points: ScriptableObject localization settings, optional ISteamService for Steam language detection, MessagePipe events for language load/change notifications, and localization-aware UI components that auto-update.
Quick Start
Call the LocalizationService from your installer, preload or set the desired SystemLanguage, and refresh UI components to see localized text and language-specific asset paths immediately.