Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Discord server
Recent changes
Random page
Community
Discord
Steam
Search
Search
English
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Lang/doc
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
Purge
General
What links here
Related changes
Special pages
Page information
Languages
Appearance
move to sidebar
hide
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!
Preview
Advanced
Special characters
Help
Heading
Level 2
Level 3
Level 4
Level 5
Format
Insert
Latin
Latin extended
IPA
Symbols
Greek
Greek extended
Cyrillic
Arabic
Arabic extended
Hebrew
Bangla
Tamil
Telugu
Sinhala
Devanagari
Gujarati
Thai
Lao
Khmer
Canadian Aboriginal
Runes
Á
á
À
à
Â
â
Ä
ä
Ã
ã
Ǎ
ǎ
Ā
ā
Ă
ă
Ą
ą
Å
å
Ć
ć
Ĉ
ĉ
Ç
ç
Č
č
Ċ
ċ
Đ
đ
Ď
ď
É
é
È
è
Ê
ê
Ë
ë
Ě
ě
Ē
ē
Ĕ
ĕ
Ė
ė
Ę
ę
Ĝ
ĝ
Ģ
ģ
Ğ
ğ
Ġ
ġ
Ĥ
ĥ
Ħ
ħ
Í
í
Ì
ì
Î
î
Ï
ï
Ĩ
ĩ
Ǐ
ǐ
Ī
ī
Ĭ
ĭ
İ
ı
Į
į
Ĵ
ĵ
Ķ
ķ
Ĺ
ĺ
Ļ
ļ
Ľ
ľ
Ł
ł
Ń
ń
Ñ
ñ
Ņ
ņ
Ň
ň
Ó
ó
Ò
ò
Ô
ô
Ö
ö
Õ
õ
Ǒ
ǒ
Ō
ō
Ŏ
ŏ
Ǫ
ǫ
Ő
ő
Ŕ
ŕ
Ŗ
ŗ
Ř
ř
Ś
ś
Ŝ
ŝ
Ş
ş
Š
š
Ș
ș
Ț
ț
Ť
ť
Ú
ú
Ù
ù
Û
û
Ü
ü
Ũ
ũ
Ů
ů
Ǔ
ǔ
Ū
ū
ǖ
ǘ
ǚ
ǜ
Ŭ
ŭ
Ų
ų
Ű
ű
Ŵ
ŵ
Ý
ý
Ŷ
ŷ
Ÿ
ÿ
Ȳ
ȳ
Ź
ź
Ž
ž
Ż
ż
Æ
æ
Ǣ
ǣ
Ø
ø
Œ
œ
ß
Ð
ð
Þ
þ
Ə
ə
Formatting
Links
Headings
Lists
Files
Discussion
References
Description
What you type
What you get
Italic
''Italic text''
Italic text
Bold
'''Bold text'''
Bold text
Bold & italic
'''''Bold & italic text'''''
Bold & italic text
Description
What you type
What you get
Reference
Page text.<ref>[https://www.example.org/ Link text], additional text.</ref>
Page text.
[1]
Named reference
Page text.<ref name="test">[https://www.example.org/ Link text]</ref>
Page text.
[2]
Additional use of the same reference
Page text.<ref name="test" />
Page text.
[2]
Display references
<references />
↑
Link text
, additional text.
↑
Link text
=Overview= overview =Functions= ==get_string== Localizes a given string to the current language, i.e. [[Data:Lang_en.json]] for english. ===Parameters=== * '''key''' - Key string to localize * '''lang_code_override''' (OPTIONAL) - Overrides the current language to a specific language code * '''fallback_str''' (OPTIONAL) - Passing <code>en</code> causes it to return the english localization if it can't be localized to the current language. Passing any other string causes it to return that string if it can't be localized. Both have [[Template:MissingValveTranslationTooltip]] appended. Use this very often as some keys are not yet localized in every language by the game. Passing <code>dictionary</code> causes it to return the translation via [[Data:Dictionary]] if it can't be localized. If parsing the fallback_str from lua and is computationally expensive (i.e. add_space_before_cap), consider using fallback outside this function so it only computes when needed. * '''remove_var_index''' (OPTIONAL) - Removes %variables% from the resulting string. -1 also removes the character prefixing %variables%, while 1 removes the postfixed character, and 0 removes only the %variables%. NOTE: Optional parameters are ideally named when not all parameters are provided, though named parameters can only be passed by invoke, and not internal lua calls. ===Examples=== Invokes from wikitext:<br> <code><nowiki>{{#invoke:Lang|get_string|CitadelHeroStats_Weapon_Falloff}}</nowiki></code> {{#invoke:Lang|get_string|CitadelHeroStats_Weapon_Falloff}} <code><nowiki>{{#invoke:Lang|get_string|CitadelHeroStats_Weapon_Falloff|lang_code_override=es}}</nowiki></code> {{#invoke:Lang|get_string|CitadelHeroStats_Weapon_Falloff|lang_code_override=es}} ===Examples for fallback_str=== <code><nowiki>{{#invoke:Lang|get_string|StatDesc_CritDamageBonusScale|lang_code_override=es}}</nowiki></code> {{#invoke:Lang|get_string|StatDesc_CritDamageBonusScale|lang_code_override=es}} <code><nowiki>{{#invoke:Lang|get_string|StatDesc_CritDamageBonusScale|lang_code_override=es|fallback_str=en}}</nowiki></code> {{#invoke:Lang|get_string|StatDesc_CritDamageBonusScale|lang_code_override=es|fallback_str=en}} <code><nowiki>{{#invoke:Lang|get_string|StatDesc_CritDamageBonusScale|lang_code_override=es|fallback_str=Crit Damage Bonus Scale}}</nowiki></code> {{#invoke:Lang|get_string|StatDesc_CritDamageBonusScale|lang_code_override=es|fallback_str=Crit Damage Bonus Scale}} <code><nowiki>{{#invoke:Lang|get_string|Tech Items|fallback_str=dictionary}}</nowiki></code> {{#invoke:Lang|get_string|Tech Items|fallback_str=dictionary}} ===Examples for remove_var_index=== <code><nowiki>{{#invoke:Lang|get_string|Citadel_HeroBuilds_DefaultHeroBuild}}</nowiki></code> {{#invoke:Lang|get_string|Citadel_HeroBuilds_DefaultHeroBuild}} <i>TODO: Debug why is =0 still removing that extra space? Doesn't matter yet I suppose, no use cases for 0 yet</i> <code><nowiki>{{#invoke:Lang|get_string|Citadel_HeroBuilds_DefaultHeroBuild|remove_var_index=0}}</nowiki></code> {{#invoke:Lang|get_string|Citadel_HeroBuilds_DefaultHeroBuild|remove_var_index=0}} <code><nowiki>{{#invoke:Lang|get_string|Citadel_HeroBuilds_DefaultHeroBuild|remove_var_index=-1}}</nowiki></code> {{#invoke:Lang|get_string|Citadel_HeroBuilds_DefaultHeroBuild|remove_var_index=-1}} When calling by internal modules, the parameters cannot be named, and therefore have to be in order. Unused parameters before the last used parameter should be <code>nil</code>. Such as, <code>.get_string('hero_atlas', nil, 'en')</code> ==search_string== Searches for the unlocalized key corresponding to a given english string, then localizes it to the current language. NOTE: Use sparingly, always use '''get_string''' instead where plausible, as it has time complexity O(1) compared to search_string's O(10,000). ===Parameters=== * '''string''' - English string to search for ===Examples=== From wikitext:<br> <pre>{{#invoke:Lang|search_string|Abrams}}</pre> {{#invoke:Lang|search_string|Abrams}}
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
Template:MissingValveTranslationTooltip
(
edit
)
Template:Tooltip
(
edit
)
Module:Dictionary
(
edit
)
Module:Lang
(
edit
)
Module:Utilities
(
edit
)
Data:Dictionary
(
edit
)
Data:LangCodes.json
(
edit
)
Data:Lang en.json
(
edit
)
Data:Lang es.json
(
edit
)