Page 1 of 1

localization for game scene?

Posted: Wed Nov 15, 2017 1:47 am
by Yob
Hi. Tony!
i am working my game fine with your support!

and i am now working on localization.
with dialogue system for unity, i get that i can localize the dialogue easily.

now what im trying is to localize UI elements.
it supports localization with only letters?
i hope to change images when localizing(like flag left top of the screen to show which language is on now).

and! lastly, how can i use localized text table for get player's setting language at first time.
I mean, when the player is firstly on the game , the default language would be set to the language of the phone's setting language.

is it possible with localized text table? if so, can you tell me how to apply this shortly? TT
or if not, then i have to make a popup or setting language button the player should choose in the very beginning. am i correct?


p.s !!

and in the documentations,
To use a localization text table in a script, call:

LocalizedTextTable["fieldname"];
where fieldname is the name of the field. This will return the current value of the field based on the current language. Example:

string reloadMessage = myLocalizedTextTable["Reload game"];
but my own script, nothing loaded...TT
do i have to write "using something" on the top of my script?
how can i load localized text table in my scripts to put a text to a string variable from LocalizedTextTable!



Thanks for your great support!

Re: localization for game scene?

Posted: Wed Nov 15, 2017 8:57 am
by Tony Li
Yob wrote: Wed Nov 15, 2017 1:47 amnow what im trying is to localize UI elements.
it supports localization with only letters?
i hope to change images when localizing(like flag left top of the screen to show which language is on now).
Yes, currently only text. I2 Localization support is coming soon. You could combine the Dialogue System's localization with I2 Localization to handle images. Or you can store the country's flag name in a localized text table field, and write a script that loads the current flag image from Resources. Something like:

Code: Select all

void UpdateCountryImage() {
    var imageName = DialogueManager.GetLocalizedText("Country Image");
    countryImage.sprite = Resources.Load<Sprite>(imageName);
}
Yob wrote: Wed Nov 15, 2017 1:47 amhow can i use localized text table for get player's setting language at first time.
On the Dialogue Manager tick Display Settings > Localization Settings > Use System Language.
Yob wrote: Wed Nov 15, 2017 1:47 amhow can i load localized text table in my scripts to put a text to a string variable from LocalizedTextTable!
If the localized text table is assigned to the Dialogue Manager, use DialogueManager.GetLocalizedText:

Code: Select all

string reloadMessage = DialogueManager.GetLocalizedText("Reload game");


If you're localizing a UI Text or UI Dropdown element, see Localizing Unity UI.

Re: localization for game scene?

Posted: Thu Nov 16, 2017 4:11 am
by Yob
Thanks! i will try.

the code which can get image is cool. i will try that way.

and i wonder what i2 localization support is coming soon does mean?
you mean if i buy i2 localization asset, i will combine with dialogue system for unity and i2?

one more thing! if the player use a language which is not in my localized text table.
then how can i set English as default?
I ticked use system language. and i tried some experiment. and it didn't show anything when i set other language other than the language i localized in my local text table. :(

please let me know
Thanks Tony!

Re: localization for game scene?

Posted: Thu Nov 16, 2017 9:41 am
by Tony Li
Hi,

Each field in the localized text table should have a Default value as its first value. If the player's system language isn't one of the languages defined in the localized text table, it will use the Default value.

This means that you don't have to include a separate English value. For English, just use the Default value.