Difference between revisions of "Module:Jbo-etym"
DavidWhitten (talk | contribs) (Created page with "local export = {} function export.show(frame) local args = frame:getParent().args return "''In Lojbanized spelling.''" .. append(args, "zh") .. append(args, "en") ....") |
DavidWhitten (talk | contribs) |
||
Line 31: | Line 31: | ||
if args[code..'_tr'] then | if args[code..'_tr'] then | ||
− | if mw.ustring.find(args[code .. '_tr'],'[%[%](){}]') then error('unauthorized characters') end | + | if mw.ustring.find(args[code .. '_tr'],'[%[%](){}]') then |
+ | error('unauthorized characters') end | ||
ret = ret .. " (" .. args[code .. '_tr'] .. ")" | ret = ret .. " (" .. args[code .. '_tr'] .. ")" | ||
end | end |
Revision as of 13:19, 14 May 2018
local export = {}
function export.show(frame) local args = frame:getParent().args
return "In Lojbanized spelling." .. append(args, "zh") .. append(args, "en") .. append(args, "hi") .. append(args, "es") .. append(args, "ru") .. append(args, "ar") end
function append(args, code) local ret = ""
if args[code] then local lang = require("Module:languages").getByCode(code) ret = ret .. "\n* " .. lang:getCanonicalName() .. ": " .. args[code]
if args[code .. '_t'] then local m_links = require("Module:links")
ret = ret .. " — ".. m_links.full_link({lang = lang, term = args[code .. '_t'], tr = (args[code..'_tr'] and "")}, nil, true)
if args[code .. '_s'] then ret = ret .. "/" .. m_links.full_link({lang = lang, term = args[code .. '_s']}, nil, true) end
if args[code..'_tr'] then if mw.ustring.find(args[code .. '_tr'],'[%[%](){}]') then
error('unauthorized characters') end
ret = ret .. " (" .. args[code .. '_tr'] .. ")" end end end
return ret end
return export