isLocalized: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Some wiki formatting)
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma3
|game1= arma3
|version1= 0.50


|0.50
|gr1= Strings


|gr1= Strings
|gr2= Localization


| Checks whether given string name is [[localize]]d.
|descr= Checks whether given ''stringName'' is [[localize]]d.
{{Informative | Since Arma 3 v2.03.147217, [[isLocalized]] accepts <tt>"$IDS<number>"</tt> and <tt>"$STR<name>"</tt> localization template formats (see [[localize]])}}
| '''isLocalized''' stringName


|p1= stringName: [[String]]
|s1= [[isLocalized]] stringName


| [[Boolean]]
|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


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


| [[localize]], [[getTextRaw]], [[WFSideText]], [[Stringtable.csv]], [[Stringtable.xml]], [[BIS_fnc_localize]]
|x1= <sqf>
}}
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";
};
</sqf>


|x2= <sqf>isLocalized "$STR_USRACT_ADJUST"; // Since Arma v2.04</sqf>


{{GameCategory|arma3|New Scripting Commands}}
|seealso= [[localize]] [[diag_localized]] [[getTextRaw]] [[WFSideText]] [[Stringtable.csv]] [[Stringtable.xml]] [[BIS_fnc_localize]]
{{GameCategory|arma3|Scripting Commands}}
}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Revision as of 21:31, 18 April 2022

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