Editing
Module
:
Dictionary/doc
(section)
Give feedback
Jump to navigation
Jump to search
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!
== 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
Navigation menu
Personal tools
Create account
Log in
associated-pages
Module
Discussion
English
Views
Read
Edit source
History
Tools
Search
Discord
Discord
Navigation
Main page
About us
Random page
Special pages
Recent changes
Grey Talon
3h ago
Β·
NotVeryTerse
Damage Amplification
3h ago
Β·
Gammaton32
Vindicta/Voice lines
4h ago
Β·
Mr. Mindish
The Doorman/Sounds
4h ago
Β·
Gammaton32
Show more...
Interface Admin
Common CSS
Vector CSS
Minerva CSS
Citizen CSS
Brown theme CSS
Gadgets
Gadgets definition
Editing
How to edit
Style guide
All guides
New files
Unresolved feedback
Tools
What links here
Related changes
Page information