BIS fnc localize: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
Line 1: Line 1:
{{Function|Comments=
{{Function


| arma3 |Game name=
| arma3


|1.00|Game version=
|1.00


|gr1 = Strings |GROUP1=
|gr1 = Strings


| Checks if passed string is localization key and if so, return the localized text. Else, returns the passed string itself.
| Checks if passed string is localization key and if so, return the localized text. Else, returns the passed string itself.
|DESCRIPTION=


| localizationString call [[BIS_fnc_localize]] |SYNTAX=


|p1= localizationString: [[String]] |PARAMETER1=
| localizationString call [[BIS_fnc_localize]]


| [[String]] - the localized text behind the key or the key itself (if not localized). |RETURNVALUE=
|p1= localizationString: [[String]]
 
| [[String]] - the localized text behind the key or the key itself (if not localized).


|x1= <code>{{codecomment|// assuming the [[Stringtable.xml|stringtable]] contains a key "STR_someString" with the value "Hello world"}}
|x1= <code>{{codecomment|// assuming the [[Stringtable.xml|stringtable]] contains a key "STR_someString" with the value "Hello world"}}
Line 20: Line 20:


{{codecomment|// assuming the [[Stringtable.xml|stringtable]] does not contain a key "STR_anotherString"}}
{{codecomment|// assuming the [[Stringtable.xml|stringtable]] does not contain a key "STR_anotherString"}}
"STR_anotherString" [[call]] [[BIS_fnc_localize]]; {{codecomment|// returns "STR_anotherString"}}</code> |EXAMPLE1=
"STR_anotherString" [[call]] [[BIS_fnc_localize]]; {{codecomment|// returns "STR_anotherString"}}</code>




| [[isLocalized]], [[localize]], [[Stringtable.xml]] |SEEALSO=
| [[isLocalized]], [[localize]], [[Stringtable.xml]]
}}
}}



Revision as of 00:12, 18 January 2021

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:
Strings

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:
isLocalizedlocalizeStringtable.xml

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

Bottom Section

Posted on December 29, 2017 - 00:03 (UTC)
Vincent H.
Unfortunately localize does not exactly do the same as BIS_fnc_localize.
BIS_fnc_localize also checks if it the input string isLocalized while localize will return an empty string if the input parameter is not localized.