Editing
Template:Translate/doc
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=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. To read the surrounding context, check for the entry on at [[Data:Dictionary/sources]] to see where each key is used. =Important translations= <i>Note: these are not yet important, as most translations are only used for in-development pages right now.<br></i> Page/subpage names that can't exist without translation and whose existence is relied on by other pages: * '''Notes''' - for <code><nowiki>[[<ability_name>/Notes]]</nowiki></code> being transcluded to [[Abrams#Abilities]] and <nowiki>[[<ability_name>]]</nowiki>. Notes page can't be created by Deadbot until translated, transcluding the english Notes in its place. * Other: * '''NeedsTranslationTooltip''' - {{NeedsTranslationTooltip}} is displayed when something can't be localized, so the tooltip being localized is quite helpful for guiding potential translators * '''MissingValveTranslationTooltip''' - {{MissingValveTranslationTooltip}} is displayed... same reason as above =When to use= This should only be used to translate text written in Templates, such as [[Template:Update layout]] which outputs "Patch notes" above the UI element. Page specific content should be translated on that page in that language, i.e. /Abrams/es or /Abrams/en =Returned string has weird characters= If [[Template:Translate]] returns a string that has <code>%s</code> in it, it means it is expecting a parameter passed to be embedded in its place. Use [[Module:Dictionary]]'s <code>translate_embed</code> function instead for this case. The linked page includes documentation for how to use it. =Example= Without providing lang_override, the language will be detected based on the subpage the user is on, i.e. /Abrams/es will be detected as a spanish page. <pre style="width: fit-content">{{Translate|Patch notes}}</pre> Outputs {{Translate|Patch notes}} <pre style="width: fit-content">{{Translate|Patch notes|ru}}</pre> Outputs {{Translate|Patch notes|ru}} If translation to that language does not yet exist, it will default to the english translation. If the english translation also does not exist, it will default to the provided key. In both cases, it will add <code><nowiki>{{NeedsTranslationTooltip}}</nowiki></code> at the end to guide users to help translate it, appearing as {{NeedsTranslationTooltip}}. <pre style="width: fit-content">{{Translate|Patch notes|made-up-code}}</pre> Outputs {{Translate|Patch notes|made-up-code}} =Lua= This template simply forwards parameters to the Lua function <code>translate</code> from [[Module:Dictionary]]. If familiar with Lua invokes, try using it or <code>translate_embed</code> instead. =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 language code to override the language (e.g., 'en', 'es'), if page ends in /<lang_code> it defaults to that lang code. See accepted language codes at [[Data:LangCodes.json]]", "type": "string", "required": false, "example": "es", "default": "" } } }</templatedata>
Summary:
Please note that all contributions to Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Deadlock:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Templates used on this page:
Data:Dictionary
(
edit
)
Data:LangCodes.json
(
edit
)
Template:MissingValveTranslationTooltip
(
edit
)
Template:NeedsTranslationTooltip
(
edit
)
Template:Tooltip
(
edit
)
Template:Translate
(
edit
)
Module:Dictionary
(
edit
)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Template
Discussion
English
Views
Read
Edit source
View history
More
Search
Navigation
Main page
Discord community
Recent changes
Random page
Tools
What links here
Related changes
Special pages
Page information
Languages