Module:languages/by name
- පහත දැක්වෙන උපදෙස්, Module:languages/by name/documentation හි පිහිටා ඇත. Module:languages/by name/documentation]]. [සංස්කරණය]
- ප්රයෝජනවත් සබැඳි: root page • root page’s subpages • සබැඳි • transclusions • testcases • sandbox
This module generates a table which maps language names to language codes. It is then loaded by Module:languages using mw.loadData()
to perform data lookup by name.
local export = {}
for code, data in pairs(require("Module:languages/data/all")) do
export[data[1]] = code
if data.otherNames then
for i, otherName in pairs(data.otherNames) do
if not export[otherName] then
export[otherName] = code
end
end
end
if data.aliases then
for i, alias in pairs(data.aliases) do
if not export[alias] then
export[alias] = code
end
end
end
end
return export