Module:User:Dixtosa

local export = {}

function string.starts(String,Start) return string.sub(String,1,string.len(Start))==Start end

--Entry point function export.GetLangNameToLangCodeMapping(prefix) local byName = mw.loadData("Module:languages/by name") local found_code = nil local found_name = nil for name, code in pairs(byName) do		if (string.starts(name, prefix.args[1])) then if found_code == nil or found_code == code then found_code = code found_name = name else return "" end end end if found_code ~= nil then return found_code..":"..found_name else return "" end end

function export.GetAllData local byName = mw.loadData("Module:languages/by name") return require("Module:JSON").toJSON(byName) end

return export