Template:Translate/doc: Difference between revisions
Jump to navigation
Jump to search
documentation initial |
m how to help translate |
||
Line 1: | Line 1: | ||
=How to help translate= | |||
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= | =Example= | ||
<pre style="width: fit-content">{{Translate|Patch notes}}</pre> | <pre style="width: fit-content">{{Translate|Patch notes}}</pre> |
Revision as of 00:52, 9 October 2024
How to help translate
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
"Patch notes": { "en": "Patch notes", "ru": "Содержание обновления" }
to
"Patch notes": { "en": "Patch notes", "ru": "Содержание обновления", "es": "Notas de revision" }
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
{{Translate|Patch notes}}
Outputs
Patch notes
{{Translate|Patch notes|ru}}
Outputs
Содержание обновления
Parameters
A template to fetch translations for a given key, optionally overriding the language.
Parameter | Description | Type | Status | |
---|---|---|---|---|
key_to_translate | 1 | The key that corresponds to the text to be translated.
| String | required |
lang_override | 2 | 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.
| String | optional |