Template:Lang/doc: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m minor phrasing for label's description |
||
Line 28: | Line 28: | ||
}, | }, | ||
"label": { | "label": { | ||
"description": "Used to search for the string by its English | "description": "Used to search for the string by its English localized string instead of using the attribute key directly", | ||
"example": "Ammo", | "example": "Ammo", | ||
"type": "string" | "type": "string" |
Revision as of 16:19, 15 September 2024
Overview
Template for retrieving localized strings from their relevant json file, such as Data:Lang_en.json for English. Note that localized strings are all pulled from raw game files.
Supports retrieval via the JSON key or by referencing it using the English label
Examples
Retrieve word by the attribute key
English string: {{Lang|key=BonusClipSize_label}} -> "Ammo"
French string: {{Lang|key=BonusClipSize_label|lang_code=fr}} -> "Munitions"
Retrieve string by label
English string: {{Lang|label=Ammo}} -> "Ammo"
French string: {{Lang|label=Ammo|lang_code=fr}} -> "Munitions"
No description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
key | key | Attribute key to directly retrieve the localized string from its JSON file
| String | optional |
label | label | Used to search for the string by its English localized string instead of using the attribute key directly
| String | optional |
lang_code | lang_code | Two-letter language code for selecting language of string. Note that this should not usually be used, as the lang code will be pulled from the URL subpage.
| String | optional |