BIS fnc localize: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Added description and example)
Line 8: Line 8:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*
| Checks if passed string is localization key and if so, return the localized text. Else, returns the passed string itself. |= Description
____________________________________________________________________________________________


Description:
| [localizationString] call [[BIS_fnc_localize]] |= Syntax
Checks if text is localization key and if so, return the localized text.


Parameter(s):
|p1= localizationString: [[String]] |= Parameter 1
_this: STRING


Returns:
| [[String]] - the localized text behind the key or the key itself (if not localized). |= Return value
STRING
*/
 
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_localize]]; --> |= Syntax
|x1= <code><i>//assuming the [[Stringtable.xml|stringtable]] contains a key "STR_someString" with the value "Hello world"</i>
["STR_someString"] [[call]] [[BIS_fnc_localize]]; //returns "Hello world"


|p1= |= Parameter 1
<i>//assuming the [[Stringtable.xml|stringtable]] does not contain a key "STR_anotherString"</i>
 
["STR_anotherString"] [[call]] [[BIS_fnc_localize]];  //returns "STR_anotherString" </code> |= Example
| |= Return value
____________________________________________________________________________________________


|x1= <code></code> |=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 16:46, 7 March 2015


Hover & click on the images for description

Description

Description:
Checks if passed string is localization key and if so, return the localized text. Else, returns the passed string itself.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[localizationString] call BIS_fnc_localize
Parameters:
localizationString: String
Return Value:
String - the localized text behind the key or the key itself (if not localized).

Examples

Example 1:
//assuming the stringtable contains a key "STR_someString" with the value "Hello world" ["STR_someString"] call BIS_fnc_localize; //returns "Hello world" //assuming the stringtable does not contain a key "STR_anotherString" ["STR_anotherString"] call BIS_fnc_localize; //returns "STR_anotherString"

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section