local function get_text(allowEtymLang, allowFamily)
local list = {"language"}
if allowEtymLang then
table.insert(list, "詞源語言")
end
if allowFamily then
table.insert(list, "語系")
end
return mw.text.listToText(list, nil, "或")
end
local export = {}
function export.code(code, paramForError, allowEtymLang, allowFamily)
local text = get_text(allowEtymLang, allowFamily) .. "代碼"
require("Module:languages/error")(code, paramForError, text)
end
function export.canonicalName(name, allowEtymLang, allowFamily)
local text = get_text(allowEtymLang, allowFamily) .. "名稱"
error(text .. "\"" .. name .. "\"無效。")
end
return export