Editing Template:Translate/docGive feedback
Jump to navigation
Jump to search
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 1: | Line 1: | ||
= | =How to help translate= | ||
Navigate to [[Data:Dictionary]] | Navigate to [[Data:Dictionary]] and add the translations for a specific key there. For example, to translate 'Patch notes' to spanish (es), edit the record in the Dictionary from | ||
<pre> | |||
"Patch notes": { | |||
"en": "Patch notes", | |||
"ru": "Содержание обновления" | |||
} | |||
</pre> | |||
to | |||
<pre> | |||
"Patch notes": { | |||
"en": "Patch notes", | |||
"ru": "Содержание обновления", | |||
"es": "Notas de revision" | |||
} | |||
</pre> | |||
Similarly, if translating a new key not yet added, simply add the record that looks like the above at the bottom of the page, but be sure the last curly brace } has a comma afterwards. | |||
=== | =Example= | ||
<pre style="width: fit-content">{{Translate|Patch notes}}</pre> | |||
Outputs | |||
{{Translate|Patch notes}} | |||
<templatedata> | |||
{ | <pre style="width: fit-content">{{Translate|Patch notes|ru}}</pre> | ||
Outputs | |||
{{Translate|Patch notes|ru}} | |||
=Parameters= | |||
<templatedata>{ | |||
"description": "A template to fetch translations for a given key, optionally overriding the language.", | |||
"params": { | |||
"1": { | |||
"label": "key_to_translate", | |||
"description": "The key that corresponds to the text to be translated.", | |||
"type": "string", | |||
"required": true, | |||
"example": "Patch notes" | |||
}, | |||
"2": { | |||
"label": "lang_override", | |||
"description": "Optional two-letter language code to override the language (e.g., 'en', 'es'), if page ends in /<lang_code> it defaults to that lang code.", | |||
"type": "string", | |||
"required": false, | |||
"example": "es", | |||
"default": "" | |||
} | |||
} | |||
}</templatedata> | }</templatedata> | ||