Editing
Module:Dictionary/doc
(section)
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!
==translate== Translates a given key using [[Data:Dictionary]]. ===Parameters=== *'''key''' - key to translate *'''lang_code_override''' (OPTIONAL, Named parameter) - language code that overrides current language. See supported list at [[Data:LangCodes.json]]. *'''fallback_str''' (OPTIONAL, Named parameter) - string to return if '''key''' cannot be translated. Defaults to the english translation. Use a blank string or nil for easier catching of missed translations, where the needs translation tooltip will also not be added. *'''show_needs_translation''' (OPTIONAL, Named parameter) - boolean that determines if the {{NeedsTranslationTooltip}} is appended when its unable to be translated. Defaults to 'true' ===Example=== Example where translation does exist<br> <code><nowiki>{{#invoke:Dictionary|translate|Update history|lang_code_override=en}}</nowiki></code> Outputs {{#invoke:Dictionary|translate|Update history|lang_code_override=en}} Example where translation does not yet exist<br> <code><nowiki>{{#invoke:Dictionary|translate|Update history|lang_code_override=es}}</nowiki></code> Outputs {{#invoke:Dictionary|translate|Update history|lang_code_override=es}} Example where translation does not yet exist but displaying the tooltip is off<br> <code><nowiki>{{#invoke:Dictionary|translate|Update history|lang_code_override=es|show_needs_translation=false}}</nowiki></code> Outputs {{#invoke:Dictionary|translate|Update history|lang_code_override=es|show_needs_translation=false}} Example where translation does not yet exist and the fallback is an empty string<br> <code><nowiki>{{#invoke:Dictionary|translate|Update history|lang_code_override=es|fallback_str=}}</nowiki></code> Outputs {{#invoke:Dictionary|translate|Update history|lang_code_override=es|fallback_str=}} Example where translation does not yet exist and the fallback is another text<br> <code><nowiki>{{#invoke:Dictionary|translate|Update history|lang_code_override=es|fallback_str=My custom fallback text}}</nowiki></code> Outputs {{#invoke:Dictionary|translate|Update history|lang_code_override=es|fallback_str=My custom fallback text}}
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
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Module
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