isLocalized: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (update to v2.04)
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *S([a-z ])" to "$1 - s$2")
 
(13 intermediate revisions by 2 users not shown)
Line 2: Line 2:


|game1= arma3
|game1= arma3
|version1= 0.50
|version1= 0.50


Line 9: Line 8:
|gr2= Localization
|gr2= Localization


|descr= Checks whether given string name is [[localize]]d.
|descr= Checks whether given ''stringName'' is [[localize]]d.


|s1= '''isLocalized''' string
|s1= [[isLocalized]]  stringName


|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
|p1= stringName: [[String]] - string which leads to localisation. Casing does not matter. Since Arma 3 v2.04 a string starting with {{hl|"$"}} is supported as well


|r1= [[Boolean]]
|r1= [[Boolean]]


|x1= <code>[[if]] ([[isLocalized]] "STR_USRACT_ADJUST") [[then]]
|x1= <sqf>
if (isLocalized "STR_USRACT_ADJUST") then  
{
{
[[hint]] [[localize]] "STR_USRACT_ADJUST";
hint localize "STR_USRACT_ADJUST";
}  
}  
[[else]]
else  
{
{
[[hint]] "STR_USRACT_ADJUST";
hint "STR_USRACT_ADJUST";
[[diag_log]] "ToDo: STR_USRACT_ADJUST is not localized";
diag_log "ToDo: STR_USRACT_ADJUST is not localized";
};</code>
};
</sqf>


|x2= <code>[[isLocalized]] "$STR_USRACT_ADJUST"; {{cc|Since Arma v2.04}}</code>
|x2= <sqf>isLocalized "$STR_USRACT_ADJUST"; // Since Arma v2.04</sqf>


|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]]
}}
}}

Latest revision as of 15:49, 8 November 2023

Hover & click on the images for description

Description

Description:
Checks whether given stringName is localized.
Groups:
StringsLocalization

Syntax

Syntax:
isLocalized stringName
Parameters:
stringName: String - string which leads to localisation. Casing does not 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

See also:
localize diag_localized getTextRaw WFSideText Stringtable.csv Stringtable.xml BIS_fnc_localize

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