Home
Random
Log in
Settings
About the Deadlock Wiki
Search
Editing
Module
:
Dictionary/doc
Give feedback
Warning:
You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more
.
Log in
or
create an account
to continue receiving notifications after this account expires, and to access other features.
Anti-spam check. Do
not
fill this in!
= Overview = See {{tl|Translate}} for how/when to use and more documentation. == p.translate == Translates a given key from [[Data:Dictionary]]. '''Manual invocation should only be used when additional parameters are required''', such as {{tl|Update layout}}, where the DISPLAYTITLE is generated using a translation key with expected parameters. For normal usage, use the basic template. === Function parameters === * '''key''' – translation key (required). * Language-specific: ** '''lang_code_override''' (optional, named parameter) – language code overriding the automatic detection. See [[Data:LangCodes.json]]. ** '''fallback_str''' (optional, named parameter) – value returned '''only if translation is missing'''. If set to empty string or nil, fallback will be empty (useful for detecting missing translations). === Examples === <code><nowiki>{{#invoke:Dictionary|translate|Update history}}</nowiki></code> Output: {{#invoke:Dictionary|translate|Update history}} <code><nowiki>{{#invoke:Dictionary|translate|Updates|lang_code_override=pt-br}}</nowiki></code> Output: {{#invoke:Dictionary|translate|Updates|lang_code_override=pt-br}} <code><nowiki>{{#invoke:Dictionary|translate|Update history|fallback_str=Custom fallback text.}}</nowiki></code> Output: {{#invoke:Dictionary|translate|Updates|lang_code_override=xx<!-- invalid language code to force fallback. -->|fallback_str=Custom fallback text.}} <includeonly>[[Category:Modules]]</includeonly><noinclude>[[Category:Module documentation]]</noinclude>
Summary:
Please note that all contributions to The 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
Pages included on this page:
Template:NeedsTranslationTooltip
(
edit
)
Template:Tl
(
edit
)
Template:Tooltip
(
edit
)
Module:Dictionary
(
edit
)
Data:Dictionary
(
edit
)
Data:LangCodes.json
(
view source
) (⧼restriction-level-bot+⧽)