Setitng the default language for testing

More
9 years 2 months ago #433 by blit
Hi,

I seem to having a problem with the plugin. I add the 'Set Language' script to my game controller in order to swap the language for testing, and it never updates. All the text remains in English. When I log out the current language using: Debug.Log (I2.Loc.LocalizationManager.CurrentLanguage) it always returns 'English' even though I have set up 'Spanish'.

Can anyone help me with this?

Please Log in or Create an account to join the conversation.

More
9 years 2 months ago #434 by Frank
Hi,

SetLanguage is used on most example scenes. Is it working fine for you on those scenes (e.g. the standard unity example scene)?

When you add a SetLanguage script to your controller, it will list the languages defined in the I2Languages.prefab and allow you changing between them.
If you added a LanguageSource to your scene and want to set a language only available in that source, then you have to reference that source in the object field at the bottom of the SetLanguage inspector.

That way, the SetLanguage popup will show the languages in that source and you will be able to change them.

Also, be aware that just by adding the SetLanguage script, it doesn't change the language by default. You have to call the OnClick or ApplyLanguage funtions. In the example scenes, I have a Button script that when ever a button is clicked, it calls the OnClick function of the SetLanguage.

If you are using the new UnityUI or NGUI, you may have to drag the object into your button and set it so when the button is clicked, that function gets called.

BTW: Yesterday I released version 2.4.0 b1. That introduces changes related to how the SetLanguage show the languages. Now it will not only show I2Languages.prefab by default, but ALL loaded sources as well.

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

Please Log in or Create an account to join the conversation.

Time to create page: 0.692 seconds
Template by JoomlaShine