But when on device default localization isnt english after start of the app users see english version of the text for ~ 0.1s and after it changes to right language.
On second load of the scene (without reboot app) all text in correct language from start.
How I can fix this?
This is due to the Addressables loading. We do it asynchronously which means Unity can still run whilst the loading is happening.
You have a few ways to handle this. Preloading will allow you to mark tables to be loaded at start, this will mean that things should be immediately available.
You will still need to wait for the initialization operation to complete for Preloading. You can either implement a loading screen for this, check the package samples for an example.
You can also set the LocalizationSettings to Initialize Synchronously(Project Settings/Localization) which will force the InitializationOperation to complete immediately when it is started but this will mean the main thread is blocked, this can make the app appear to be unresponsive if its loads a lot of data.
I found this thread since I was experiencing exactly what was described above. It seems that the UI has changed, so the instructions in the Preloading section (in the latest version 1.5.0-pre.6 of the documentation) canāt be followed for preloading the tables.
The closest Iāve found to this is in the localization settings, under āPreload Behaviorā and āInitialize Synchronouslyā:
Unfortunately, when hitting play, the default English locale shows and after a small delay (0.5s-1s) it changes to Chinese, which is set for testing in the Awake function (I also test it on the Start function with a similar result).
The preload option has moved to the main table window, just under the top where you select the table. Itās supposed to be easier to find
The option is now applied to all tables instead of per table.
We will get the docs updated before we come out of the pre-release
Are we talking about this window? Sorry, I only know the āLocalizationTableā, ālocalesā, and āLocalizationSettingsā windows. I bet itās got to be something easy to find so my apologies
Thank you for the walk-through, I managed to get it working
So, a quick summary. Assuming youāre not using a custom loading screen and want to preload the tables so that the first thing you see is the correct locale already loaded based on SystemLanguage or userās preferences (so that you donāt see that glitch-like language change on app launch).
For this to work, there seems to be 3 steps needed:
(1) The Preload Table checkmark of your target table(s) or the Preload All Tables checkmark enabled in the metadata button ({@}) of the āLocalizationTablesā window.
(2) The Preload Behavior set to Preload your Selected Locale(s)/Fallbacks or Preload All Locales in the āLocalizationSettingsā window.
(3) The Initialize Synchronously checkmark set to āenabledā in the āLocalizationSettingsā window.
What version of the package are you using. Try updating to 1.5.3. if itās not visible in the package manager you can update the manifest.json file in the a Packages folder.
Otherwise you can look in the Metadata for the table by clicking the little icon next to the language. We moved the option in 1.5.
It worked as expected when I followed all these 3 steps. Thanks Guirie. Unity v2022.3.37f1.
Preload nicely done and game started with selected locale.
Btw, Karl: Localization 1.5.3