Used for string localisation (translation in to other languages)... |
var localisedStr = _("string"); |
Parameter | Type | Mandatory | Notes | Game Version |
---|---|---|---|---|
"string" | String literal | The string to translate. Must be a primitive, string literal. See Notes section below for more details as to why. | 3.1 Beta 1 |
Value | Type | Notes | Game Version |
---|---|---|---|
<localisedStr> | String | The localised version of the str. If no localised version of str exists, str will be returned. | 3.1 Beta 1 |
Localisation happens in two stages.
The first stage is part of the design/build process, and uses _() merely as a marker for strings that need localisation:
For this reason, you can't use variables or constants inside of _(), because that would confuse the gettext script.
Then, at run-time, the _() actually does the localisation:
Currently there's no way to determine what language other players in an MP game speak, and there's no way to specify a target locale in the _() function. See related forum topics for more information.
If you want to know more about localising Warzone 2100, view the official translations topic in the forums.
console(_("hello world")); // translate "hello world" in to user's language |
Thanks to everyone in the forums who helped explain the workings of this function! |
AvailabilityRequires:
|
ContentsJump to: |