Variable ["Alert"] Is it possible to translate?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
minomod
Posts: 89
Joined: Mon Jun 19, 2017 9:17 am

Variable ["Alert"] Is it possible to translate?

Post by minomod »

I would like to have a different message for each country.
Attachments
1.png
1.png (39.71 KiB) Viewed 738 times
User avatar
Tony Li
Posts: 21033
Joined: Thu Jul 18, 2013 1:27 pm

Re: Variable ["Alert"] Is it possible to translate?

Post by Tony Li »

Yes. Alert text isn't considered dialogue text, so the translations for alert text need to be in a localized text table assigned to the Dialogue Manager's Display Settings > Localization Settings > Localized Text.

If the localized text table has a field for "ABCD", then the alert will automatically use the language-specific version of that field.
minomod
Posts: 89
Joined: Mon Jun 19, 2017 9:17 am

Re: Variable ["Alert"] Is it possible to translate?

Post by minomod »

Are you talking about this menu?
Attachments
2.png
2.png (27.91 KiB) Viewed 733 times
User avatar
Tony Li
Posts: 21033
Joined: Thu Jul 18, 2013 1:27 pm

Re: Variable ["Alert"] Is it possible to translate?

Post by Tony Li »

No. To localize alerts and non-dialogue UI elements, you'll use a different type of asset file called a Localized Text Table, not a dialogue database. The Localized Text Table's inspector looks like this:
Image
and this:
Image
After creating the Localized Text Table, remember to assign it to the Dialogue Manager.
minomod
Posts: 89
Joined: Mon Jun 19, 2017 9:17 am

Re: Variable ["Alert"] Is it possible to translate?

Post by minomod »

Dialogue System: Lua code 'LocalizedTextTable[abcd];' threw exception 'Lookup of field '' in the table element failed because the table element itself isn't in the table.'
Attachments
3.png
3.png (81.12 KiB) Viewed 726 times
User avatar
Tony Li
Posts: 21033
Joined: Thu Jul 18, 2013 1:27 pm

Re: Variable ["Alert"] Is it possible to translate?

Post by Tony Li »

You only need this Script field:

Code: Select all

Variable["Alert"] = "ABCD"
Because you assigned a Localized Text Table to the Dialogue Manager, it will automatically look up "ABCD" and use the translation.
Post Reply