Scripts/Alerts and Localization

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
chud575
Posts: 50
Joined: Thu May 11, 2017 10:57 am

Scripts/Alerts and Localization

Post by chud575 »

Howdy once more,

so I'm fiddling with your ORK integration and I noticed that you call an alert from the script field

Code: Select all

Variable["Alert"] = "Lost 10 gold, gained 50 faction.";
So my question is - how do hardcoded alerts like these work with localization?
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Scripts/Alerts and Localization

Post by Tony Li »

If you've assigned a localized text table to the Dialogue Manager, it will look for a table entry with the key "Lost 10 gold, gained 50 faction." If it finds one, it'll use the localized version. Otherwise it will show the string directly.

Unlike the Sequence field (which can have localized variants such as "Sequence en" and "Sequence fr"), the Script and Conditions fields don't have localized variants.

If that doesn't meet your needs, you could register your own C# function with Lua, similar to the ShowAlert("string") Lua function, and use it to localize your text before sending it to DialogueManager.ShowAlert().
Post Reply