Language Persistence
Last updated
Last updated
If you would like to persist language across the game runs, use LocalizationPrefs component. Attach the component to any game object you want. LocalizationPrefs uses the PlayerPrefs to keep application language on the device storage. So you can set PlayerPrefs key from Pref Key field from inspector.
When the user selects a language from e.g. drop-down, LocalizationPrefs detects the language change and saves the selected language to the PlayerPrefs with key you chosen. Whenever application starts, LocalizationPrefs restores the selected language and sets the application language.You should place LocalizationPrefs game object into the initial scene of your game.