{{t-simple|la|nasus|alt=nāsus|langname=Latin}}
local export = {}
function export.show(frame)
local params = {
= { required = true }, -- language code
= { required = true }, -- term
= { alias_of = "g" }, -- gender
g = { list = true },
alt = {}, -- displayed text
tr = {}, -- transliteration
lit = {}, -- literal translation
id = {}, -- sense id
}
local args = require "Module:parameters".process(frame.args, params, true)
local lang = require "Module:languages".getByCode(args)
or require "Module:languages".err(args, 1)
local output = require "Module:array" "{{t-simple"
local alt = args.alt
if not alt then
entry_name = lang:makeEntryName(args)
if entry_name ~= args then
args, alt = entry_name, args
end
end
for _, param in ipairs {
{ 1, lang:getCode() },
{ 2, args },
{ "alt", alt },
{ "sc", args.sc },
{ "g", args.g },
{ "tr", args.tr },
{ "langname", lang:getCanonicalName() },
} do
local key, value = unpack(param)
if value then
if type(key) == "number" then
output:insert("|" .. value)
else
output:insert("|" .. key .. "=" .. value)
end
end
end
output:insert "}}"
return output:concat()
end
return export