BIS fnc localize: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <!-- (DIS)?CONTINUE Notes -->" to "") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
|game1= arma3 | |game1= arma3 | ||
|version1= 1.00 | |version1= 1.00 | ||
|gr1 = Strings | |gr1= Strings | ||
|descr= Checks if passed string is localization key and if so, return the localized text. Else, returns the passed string itself. | |descr= Checks if passed string is localization key and if so, return the localized text. Else, returns the passed string itself. | ||
Line 15: | Line 14: | ||
|r1= [[String]] - the localized text behind the key or the key itself (if not localized). | |r1= [[String]] - the localized text behind the key or the key itself (if not localized). | ||
|x1= < | |x1= <sqf> | ||
"STR_someString" | // 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" | "STR_anotherString" call BIS_fnc_localize; // returns "STR_anotherString" | ||
</sqf> | |||
|seealso= [[isLocalized]] | |seealso= [[isLocalized]] [[localize]] [[Stringtable.xml]] | ||
}} | }} | ||
{{Note | |||
|user= Vincent H. | |||
|timestamp= 20171229000300 | |||
|text= Unfortunately [[localize]] does not exactly do the same as [[BIS_fnc_localize]].<br> | |||
Unfortunately [[localize]] does not exactly do the same as [[BIS_fnc_localize]].<br> | |||
[[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. | [[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. | ||
}} | |||
Latest revision as of 20:33, 18 April 2022
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:
Additional Information
- See also:
- isLocalized localize Stringtable.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
- Posted on Dec 29, 2017 - 00:03 (UTC)
-
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.