Module:Lang/doc: Difference between revisionsGive feedback
m fallback_str example now more helpful |
m recommendation for fallback_str |
||
| 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. Both have [[Template:MissingValveTranslationTooltip]] appended. 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. If parsing the fallback_str from lua and is computationally expensive (i.e. add_space_before_cap), consider using fallback outside this function so it only computes when needed. | ||
* '''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%. | ||