2,788
edits
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
end | end | ||
function export. | function export.get_by_name(name) | ||
local lang = export.find_by_canonical_name(name) | local lang = export.find_by_canonical_name(name) | ||
if lang == nil then error("No such language (" .. name .. ")") end | if lang == nil then error("No such language (" .. name .. ")") end | ||
Line 20: | Line 20: | ||
end | end | ||
function export. | function export.find_by_name(name) | ||
local code = mw.loadData("Module:languages/ | local code = mw.loadData("Module:languages/names")[name] | ||
if code == nil then return nil end | if code == nil then return nil end | ||
return export.find_by_code(code) | return export.find_by_code(code) |