Module:Lang/doc: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m documentation updates for new combined get_string |
m fallback_str example now more helpful |
||
| Line 9: | Line 9: | ||
* '''key''' - Key string to localize | * '''key''' - Key string to localize | ||
* '''lang_code_override''' (OPTIONAL) - Overrides the current language to a specific language code | * '''lang_code_override''' (OPTIONAL) - Overrides the current language to a specific language code | ||
* '''fallback_str''' (OPTIONAL) - Passing <code>en</code> causes it to return the english localization if it can't be localized to the current language. Passing any other string causes it to return that string if it can't be localized. Use this very often as some keys are not yet localized in every language by the game. | * '''fallback_str''' (OPTIONAL) - Passing <code>en</code> causes it to return the english localization if it can't be localized to the current language. Passing any other string causes it to return that string if it can't be localized. Both have [[Template:MissingValveTranslationTooltip]] appended. Use this very often as some keys are not yet localized in every language by the game. | ||
* '''remove_var_index''' (OPTIONAL) - Removes %variables% from the resulting string. -1 also removes the character prefixing %variables%, while 1 removes the postfixed character, and 0 removes only the %variables%. | * '''remove_var_index''' (OPTIONAL) - Removes %variables% from the resulting string. -1 also removes the character prefixing %variables%, while 1 removes the postfixed character, and 0 removes only the %variables%. | ||
| Line 28: | Line 28: | ||
===Examples for fallback_str=== | ===Examples for fallback_str=== | ||
<code><nowiki>{{#invoke:Lang|get_string| | <code><nowiki>{{#invoke:Lang|get_string|StatDesc_CritDamageBonusScale|lang_code_override=es}}</nowiki></code> | ||
{{#invoke:Lang|get_string| | {{#invoke:Lang|get_string|StatDesc_CritDamageBonusScale|lang_code_override=es}} | ||
<code><nowiki>{{#invoke:Lang| | <code><nowiki>{{#invoke:Lang|StatDesc_CritDamageBonusScale|hero_atlas|lang_code_override=es|fallback_str=en}}</nowiki></code> | ||
{{#invoke:Lang|get_string| | {{#invoke:Lang|get_string|StatDesc_CritDamageBonusScale|lang_code_override=es|fallback_str=en}} | ||
<code><nowiki>{{#invoke:Lang|get_string|StatDesc_CritDamageBonusScale|lang_code_override=es|fallback_str=Crit Damage Bonus Scale}}</nowiki></code> | |||
{{#invoke:Lang|get_string|StatDesc_CritDamageBonusScale|lang_code_override=es|fallback_str=Crit Damage Bonus Scale}} | |||
===Examples for remove_var_index=== | ===Examples for remove_var_index=== | ||