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
Alerts multi language
Re: Alerts multi language
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):
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
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
The alert message does not come from the dialogue database. Create a Text Table asset:
(In the Project view, select Create > Pixel Crushers > Common > Text Table.)
Then add the field:
Then show the alert (example):
(In the Project view, select Create > Pixel Crushers > Common > Text Table.)
Then add the field:
Then show the alert (example):