Wrong language will be set
10 years 3 weeks ago #337
by Hacky
Wrong language will be set was created by Hacky
Hi,
after changing my system language on my iPad, my app shows the same language as before changing my settings.
How can I solve this problem?
Best regards,
David
after changing my system language on my iPad, my app shows the same language as before changing my settings.
How can I solve this problem?
Best regards,
David
Please Log in or Create an account to join the conversation.
10 years 3 weeks ago #342
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic Wrong language will be set
Hi,
When the game runs for the first time in a device, it gets the language used and saves that setting.
From that point on, it wont get the currentLanguage again, instead it will use the saved language as that could have been modified by the user if you allow changing the language within the game.
You can force reselecting the default language by running the following code in an Awake or Start method.
You will need to make the SelectStartupLanguage public.
EDIT: After reviewing a bit how this works, Maybe a good idea could be that instead of saving the language if it was selected by the default using the currentLanguage, I will only save the language if its set within the game to a different language.
That way, the default language is never saved and queried all the time the game starts. But if the player selects a different language from the menu, then it gets saved and from that point forward it will always remember that option.
That will allow for the case you mention, where the device language changes and the game changes the language accordingly if the user hasn't selected a different language.
Thanks,
Frank
When the game runs for the first time in a device, it gets the language used and saves that setting.
From that point on, it wont get the currentLanguage again, instead it will use the saved language as that could have been modified by the user if you allow changing the language within the game.
You can force reselecting the default language by running the following code in an Awake or Start method.
PlayerPrefs.DeleteKey("I2 Language");
I2.Loc.LocalizationManager.Instance.SelectStartupLanguage();
You will need to make the SelectStartupLanguage public.
EDIT: After reviewing a bit how this works, Maybe a good idea could be that instead of saving the language if it was selected by the default using the currentLanguage, I will only save the language if its set within the game to a different language.
That way, the default language is never saved and queried all the time the game starts. But if the player selects a different language from the menu, then it gets saved and from that point forward it will always remember that option.
That will allow for the case you mention, where the device language changes and the game changes the language accordingly if the user hasn't selected a different language.
Thanks,
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
The following user(s) said Thank You: Hacky
Please Log in or Create an account to join the conversation.
Time to create page: 0.198 seconds