Module:etymology/templates: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 32: Line 32:




local function fetch_script(sc, lang)
local function fetch_script(sc, source)
if sc then
if sc then
return require("Module:scripts").getByCode(sc) or error("The script code \"" .. sc .. "\" is not valid.")
return require("Module:scripts").getByCode(sc) or error("The script code \"" .. sc .. "\" is not valid.")
else
else
return lang:getScriptCodes()
return source:getScriptCodes()
end
end
end
end
Line 94: Line 94:
local source = fetch_source(args[1])
local source = fetch_source(args[1])
local sc = fetch_script(args["sc"])
local sc = fetch_script(args["sc"], source)


return m_etymology.format_cognate(
return m_etymology.format_cognate(
Line 150: Line 150:
local lang = fetch_lang(args[1], 1)
local lang = fetch_lang(args[1], 1)
local source = fetch_source(args[2], no_family)
local source = fetch_source(args[2], no_family)
local sc = fetch_script(args["sc"])
local sc = fetch_script(args["sc"], source)


return args, lang, {
return args, lang, {
Line 569: Line 569:
local lang = fetch_lang(args[1], 1)
local lang = fetch_lang(args[1], 1)
local sc = fetch_script(args["sc"])
local sc = fetch_script(args["sc"], lang)


local parts = {}
local parts = {}

Navigation menu