I’m build project with localization (1.0.3), and set Locale Selector to “System” (only one for clear experiment), and in Android/iOS works fine, tho in WebGL its not equal to navigator.languages[0] (navigator.language). I expect ‘Russian’ (ru-RU), tho get en-US => ‘en’. No matter what language i set to browser (Google Chrome v94, latest) it still return ‘en’. Can you describe approach, which used by Unity localization to detect “System Locale Selector” in WebGL?
P.s. How to get value from stringTable to use it in active messages (sent to server, log in console, etc.) : now i use the following code:
public LocalizedStringTable stringTable; // set up in Editor
Debug.Log(stringTable.GetTable().GetEntry(“myKey”).LocalizedValue);
It works, tho it looks horrible… Mb I do something wrong.
Please file a bug report for the WebGL issue. It does sound familiar, I think I even saw a fix for it the other day but its best to make a bug report to be certain.
You can use LocalizationEditorSettings to get values easier in the editor.
Thank you for your answer. I forgot to note that in dev console i log Application.systemLanguage and it says
Application.systemLanguage = Russian
But next line:
The Locale ‘en-US’ is not available, however the parent locale ‘en’ is available.
Now I’m checking it for different browsers to create bug report.
That sounds like an old bug in Addressables. Updating to the latest patch version of Unity should fix it.
Also WaitForCompletion is not supported on WebGL so you would need to do:
LocalizationSettings.StringDatabase.GetLocalizedStringAsync(“my table”, "“myKey”);