Module:Wt/sco/usex/templates
Documentation for this module may be created at Module:Wt/sco/usex/templates/doc
local m_usex = require("Module:Wt/sco/usex")
local export = {}
function export.usex_t(frame)
local params = {
[1] = {required = true},
[2] = {},
[3] = {},
["inline"] = {type = "boolean"},
["noenum"] = {type = "boolean"},
["ref"] = {},
["lit"] = {},
["q"] = {list = true},
["qualifier"] = {alias_of = "qual"},
["sc"] = {},
["source"] = {},
["subst"] = {},
["t"] = {alias_of = 3},
["translation"] = {alias_of = 3},
["tr"] = {},
["transliteration"] = {alias_of = "tr"},
}
local quote = (frame.args["quote"] or "") ~= ""
local compat = (frame.args["compat"] or "") ~= ""
local template_inline = (frame.args["inline"] or "") ~= ""
if compat then
params["lang"] = {required = true}
params["t"].alias_of = 2
params["translation"].alias_of = 2
table.remove(params, 1)
end
local args = require("Module:Wt/sco/parameters").process(frame:getParent().args, params)
local lang = args[compat and "lang" or 1] or "und"
local sc = args["sc"]
lang = require("Module:Wt/sco/languages").getByCode(lang) or require("Module:Wt/sco/languages").err(lang, ( compat and "lang" ) or 1)
sc = (sc and (require("Module:Wt/sco/scripts").getByCode(sc) or error("The script code \"" .. sc .. "\" is not valid.")) or nil)
local usex = args[compat and 1 or 2]
local translation = args[compat and 2 or 3]
local transliteration = args["tr"]
local noenum = args["noenum"]
local inline = args["inline"] or template_inline
local ref = args["ref"]
local lit = args["lit"]
local substs = args["subst"]
local qualifiers = args["q"]
local source = args["source"]
return m_usex.format_usex(lang, sc, usex, translation, transliteration, noenum, inline, ref, quote, lit, substs, qualifiers, source)
end
return export