Module:Language/Documentation
Jump to navigation
Jump to search
This is the documentation page for Module:Language
The source of truth for languages relevant to The Legend of Zelda series.
This module exports the following functions.
enum
enum([options])
Parameters
[options]
[includeWikiLanguage]
- If true, the wiki's native language (
enAm
) is included in the list.
Returns
- A list of language codes for use by Module:UtilsArg and Module:Documentation.
Examples
# | Input | Output |
---|---|---|
1 | enum()
| {
"enBr",
"ja",
"zhT",
"zhS",
"cs",
"da",
"nl",
"fi",
"frC",
"frF",
"de",
"hu",
"it",
"ko",
"he",
"no",
"pl",
"ptB",
"ptP",
"ru",
"esL",
"esS",
"sv",
reference = "[[Module:Language/Data]]",
}
|
2 | enum({ includeWikiLanguage = true })
| {
"enAm",
"enBr",
"ja",
"zhT",
"zhS",
"cs",
"da",
"nl",
"fi",
"frC",
"frF",
"de",
"hu",
"it",
"ko",
"he",
"no",
"pl",
"ptB",
"ptP",
"ru",
"esL",
"esS",
"sv",
reference = "[[Module:Language/Data]]",
}
|
getLect
getLect(code, [options])
Parameters
code
- A code from Module:Language/Data.
[options]
[flagSize=20px]
- An image size for the returned flag(s).
Returns
- A Lua table of information on a particular lect (a language or variant thereof), or
nil
if the given code does not exist in Module:Language/Data. - An error category if the given code does not exist in Module:Language/Data.
Examples
# | Input | Output | Status |
---|---|---|---|
3 | getLect("enBr")
| {
abbr = "English<sup>'\"`UNIQ--templatestyles-0000002C-QINU`\"'<span class=\"explain tooltip\" title=\"British\">BR</span></sup>",
lang = "English",
name = "British English",
flags = {
'<span class="tooltip" title="The United Kingdom of Great Britain and Northern Ireland">[[File:United Kingdom Flag.png|20px|The United Kingdom of Great Britain and Northern Ireland]]</span>',
},
}
| |
nil
| |||
4 | getLect("ja", { flagSize = "40px" })
| {
abbr = "Japanese",
lang = "Japanese",
name = "Japanese",
flags = {
'<span class="tooltip" title="Japan">[[File:Japan Flag.png|40px|Japan]]</span>',
},
}
| |
nil
| |||
5 | getLect("zhT")
| {
abbr = "Chinese<sup>'\"`UNIQ--templatestyles-00000009-QINU`\"'<span class=\"explain tooltip\" title=\"Traditional\">TR</span></sup>",
lang = "Chinese",
name = "Traditional Chinese",
flags = {
'<span class="tooltip" title="The Republic of China">[[File:Taiwan Flag.svg|20px|The Republic of China]]</span>',
'<span class="tooltip" title="The Hong Kong Special Administrative Region of China">[[File:Hong Kong Flag.svg|20px|The Hong Kong Special Administrative Region of China]]</span>',
'<span class="tooltip" title="The Macao Special Administrative Region of China">[[File:Macao Flag.svg|20px|The Macao Special Administrative Region of China]]</span>',
},
}
| |
nil
| |||
6 | getLect("narnia")
| nil
| |
"[[Category:Articles using invalid arguments in template calls]]"
|