diag localized: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|game([0-9]) ?= (.+) \|version([0-9]) ?= (.+) " to "|game$1= $2 |version$3= $4 ")
m (Text replacement - "Strings" to "Strings")
 
(9 intermediate revisions by the same user not shown)
Line 8: Line 8:
|gr2= Localization
|gr2= Localization


|descr= Returns array with all [[localize]]d keys from the given [[Stringtable.xml | stringtable]] or the array of all stringtables names if empty string <tt>""</tt> is given. Common stringtables are: <tt>"Global"</tt>, <tt>"Mission"</tt>, <tt>"Campaign"</tt>.
|descr= Returns array with all [[localize]]d keys from the given [[Stringtable.xml | stringtable]] or the array of all stringtables names if empty string {{hl|""}} is given. Common stringtables are: {{hl|"Global"}}, {{hl|"Mission"}}, {{hl|"Campaign"}}.


|s1= [[diag_localized]] stringtable
|s1= [[diag_localized]] stringtable


|p1 = stringtable: [[String]] - stringtable name or ""
|p1= stringtable: [[String]] - stringtable name or ""


|r1= [[Array]] - array of [[Strings]], see description
|r1= [[Array]] - array of [[String]]s, see description


|x1 = <code>[[private]] _randomKey = [[selectRandom]] [[diag_localized]] "Global";  
|x1= <sqf>
[[hint]] [[format]] ["Key: %1\nValue: %2", _randomKey, [[localize]] _randomKey];</code>
private _randomKey = selectRandom diag_localized "Global";
hint format ["Key: %1\nValue: %2", _randomKey, localize _randomKey];
</sqf>


|x2 = <code>[[private]] _allTables = [[diag_localized]] "";</code>
|x2= <sqf>private _allTables = diag_localized "";</sqf>


|x3 = <code>[[diag_localized]] "Global" [[select]] 0; // "$STR_A3_SHOWCASE_SLINGLOADING_15_AMMODROPPED_PIL_0"</code>
|x3= <sqf>diag_localized "Global" select 0; // "$STR_A3_SHOWCASE_SLINGLOADING_15_AMMODROPPED_PIL_0"</sqf>


|seealso= [[localize]], [[isLocalized]], [[getTextRaw]], [[Stringtable.csv]], [[Stringtable.xml]], [[BIS_fnc_localize]]
|seealso= [[localize]] [[isLocalized]] [[getTextRaw]] [[Stringtable.csv]] [[Stringtable.xml]] [[BIS_fnc_localize]]
}}
}}

Latest revision as of 21:51, 16 February 2024

Hover & click on the images for description

Description

Description:
Returns array with all localized keys from the given stringtable or the array of all stringtables names if empty string "" is given. Common stringtables are: "Global", "Mission", "Campaign".
Groups:
StringsLocalization

Syntax

Syntax:
diag_localized stringtable
Parameters:
stringtable: String - stringtable name or ""
Return Value:
Array - array of Strings, see description

Examples

Example 1:
private _randomKey = selectRandom diag_localized "Global"; hint format ["Key: %1\nValue: %2", _randomKey, localize _randomKey];
Example 2:
private _allTables = diag_localized "";
Example 3:
diag_localized "Global" select 0; // "$STR_A3_SHOWCASE_SLINGLOADING_15_AMMODROPPED_PIL_0"

Additional Information

See also:
localize isLocalized getTextRaw 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