Page 1 of 1

Alerts multi language

Posted: Sun Mar 15, 2020 6:01 pm
by Haytam95
Hello!

I'm making my game multilanguage (Dialogue System is just awesome) and i'm stuck at Alerts. How could i make them multilanguage?

I thought about making a conversation with all the possible alert messages and then set the Variable['Alert'] to the entry of that conversation that i need. That would be a correct aproach?

Thanks!

Ps: Sorry any typos, english isn't my main language

Re: Alerts multi language

Posted: Sun Mar 15, 2020 6:32 pm
by Tony Li
Hi,

You can assign a Text Table asset to the Dialogue Manager's Display Settings > Localization Settings field.

Before alerts are shown, the Dialogue System will check if the alert text has a translation in in the Text Table.

For example, if you show the alert "Saving game...", the Dialogue System will check the Text Table for a field named "Saving game..." and use the translation for the current language.

If you need to compose an alert at runtime, you can use DialogueManager.GetLocalizedText(string):

Code: Select all

string text = DialogueManager.GetLocalizedText("Earned") + " " + xp + " " + DialogueManager.GetLocalizedText("XP");
DialogueManager.ShowAlert(text);

Re: Alerts multi language

Posted: Sun Mar 15, 2020 6:59 pm
by Haytam95
Tony Li wrote: Sun Mar 15, 2020 6:32 pm You can assign a Text Table asset to the Dialogue Manager's Display Settings > Localization Settings field.
That's great, i didn't know that alerts would check for localization before displaying text. I didn't follow how to access to that menu. Is it in this window? Could you point me out with a picture please?



Thank you Tony

Re: Alerts multi language

Posted: Sun Mar 15, 2020 7:26 pm
by Tony Li
The alert message does not come from the dialogue database. Create a Text Table asset:

Image

(In the Project view, select Create > Pixel Crushers > Common > Text Table.)

Then add the field:

Image

Then show the alert (example):

Image

Re: Alerts multi language

Posted: Mon Mar 16, 2020 7:35 am
by Haytam95
Thanks Tony!

Re: Alerts multi language

Posted: Mon Mar 16, 2020 8:15 am
by Tony Li
Glad to help!