isLocalized: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(see also)
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *S([a-z ])" to "$1 - s$2")
 
(40 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 0.50


|0.50|= Game version
|gr1= Strings
____________________________________________________________________________________________


| Checks whether given string name is [[localize]]d.  |= Description
|gr2= Localization
____________________________________________________________________________________________


| '''isLocalized''' stringName |= Syntax
|descr= Checks whether given ''stringName'' is [[localize]]d.


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


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


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


| [[localize]], [[WFSideText]], [[Stringtable.csv File Format]] |= SEEALSO
|seealso= [[localize]] [[diag_localized]] [[getTextRaw]] [[WFSideText]] [[Stringtable.csv]] [[Stringtable.xml]] [[BIS_fnc_localize]]
 
|  |= MPBEHAVIOUR
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

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