isLocalized: Difference between revisions
(formatting and new command group) |
m (update to v2.04) |
||
Line 10: | Line 10: | ||
|descr= Checks whether given string name is [[localize]]d. | |descr= Checks whether given string name is [[localize]]d. | ||
|p1= | |s1= '''isLocalized''' string | ||
|p1= string: [[String]] - String which leads to localisation. Casing doesn't matter. Since Arma 3 v2.04 a string starting with <tt>"$"</tt> is supported as well | |||
|r1= [[Boolean]] | |r1= [[Boolean]] | ||
|x1= <code>[[if]] ([[isLocalized]] " | |x1= <code>[[if]] ([[isLocalized]] "STR_USRACT_ADJUST") [[then]] | ||
{ | { | ||
[[hint]] [[localize]] " | [[hint]] [[localize]] "STR_USRACT_ADJUST"; | ||
} | } | ||
[[else]] | [[else]] | ||
{ | { | ||
[[hint]] " | [[hint]] "STR_USRACT_ADJUST"; | ||
[[diag_log]] "ToDo: | [[diag_log]] "ToDo: STR_USRACT_ADJUST is not localized"; | ||
};</code> | };</code> | ||
|x2= <code>[[isLocalized]] "$STR_USRACT_ADJUST"; {{cc|Since Arma v2.04}}</code> | |||
|seealso= [[localize]],[[diag_localized]], [[getTextRaw]], [[WFSideText]], [[Stringtable.csv]], [[Stringtable.xml]], [[BIS_fnc_localize]] | |seealso= [[localize]],[[diag_localized]], [[getTextRaw]], [[WFSideText]], [[Stringtable.csv]], [[Stringtable.xml]], [[BIS_fnc_localize]] | ||
}} | }} |
Revision as of 15:44, 27 April 2021
Description
- Description:
- Checks whether given string name is localized.
- Groups:
- StringsLocalization
Syntax
- Syntax:
- isLocalized string
- Parameters:
- string: String - String which leads to localisation. Casing doesn't matter. Since Arma 3 v2.04 a string starting with "$" is supported as well
- Return Value:
- Boolean
Examples
- Example 1:
if (isLocalized "STR_USRACT_ADJUST") then { hint localize "STR_USRACT_ADJUST"; } else { hint "STR_USRACT_ADJUST"; diag_log "ToDo: STR_USRACT_ADJUST is not localized"; };
- Example 2:
isLocalized "$STR_USRACT_ADJUST"; // Since Arma v2.04
Additional Information
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