Category: Script / Strings
Since engine version: 1.0 OC
Looks up a text in StringTbl??.txt of the calling script and returns its translation.
string Translate(string text);
- String to translate
Assuming the StringTblUS.txt of a clonk looks like this:
MsgOnFire0=Aaaa, I am burning! MsgOnFire1=Waaah, whats this?! MsgOnFire2=Oh god, I am on fire! MsgOnFire3=Oops, I dropped my lighter!
With Translate(), the string id that should be displayed can be constructed during runtime:
When the clonk catches fire, the engine calls Incineration() in the clonk and in this example, one of the four above messages is displayed at random.
See also: GetTranslatedString