I got Language Selection Popup when the game starts for the first time.
What I am trying to do is to change SelectedLocale to System Language at startup depending on user device’s system language as well as to change the flag and text.
I think it will provide better experience to the user in this way who is not a speaker of the default fallback language --English.
I wrote scripts for this.And I needs to test that repeatedly switching system languages. My project is in very early stage of the development so building it on a real device and changing language would be really cumbersome because making and getting a certificate, app id, provisioning file will be needed too.
So, first I needed a way to change the startup language of Unity’s Play Mode in 2020.3.30 on macOS.
Does anyone know how to set it?
I could not find this, so I decided to use Device Simulator for that matter, which marks my project “Preview Packages in Use”.
Anyway, It has System Language option on Control Panel. thanks to anyone made this.
I ensured that it works with
Debug.Log("systemLang: " + Application.systemLanguage);
But, the Localization package does not pick the system language of it.
Locale Selector shoud pick up the System Language with System Locale Selector as far as I understand the manual.
void Start()
{
Debug.Log("systemLang: " + Application.systemLanguage);
LocalizationSettings.InitializationOperation.WaitForCompletion();
Debug.Log("Selected Locale: " + LocalizationSettings.SelectedLocale.LocaleName);
// Do something about popup with SelectedLocale
}
I expected SelectedLocale after LocalizationSettings.InitializationOperation, to be the same language as what I have chosen in the Simulator.
But the result of Log for SelectedLocale.LocaleName is allways “English (en)”.
If I get rid of System Locale Selector and set Specific Locale Selector with other language, for example “German (de)”, rather than English, it works with that language: SelectedLocale is “German (de)” and the proper flag is ticked.
But never works with System Language. What am I doing wrong?