This module generates a table which maps canonical language names to language codes. It is then loaded using [[mw:Extension:Scribunto/Lua reference manual#mw.loadData|lua {{mw.loadData():lua}}]] to perform data lookup by name.


local export = {}

for code, data in pairs(mw.loadData("Modul:languages/stable")) do
	export[data.names[1]] = code
end

for code, data in pairs(mw.loadData("Modul:languages/data2")) do
	export[data.names[1]] = code
end

for letter in mw.ustring.gmatch("abcdefghijklmnopqrstuvwxyz", "(.)") do
	for code, data in pairs(mw.loadData("Modul:languages/data3/" .. letter)) do
		export[data.names[1]] = code
	end
end

for code, data in pairs(mw.loadData("Modul:languages/datax")) do
	export[data.names[1]] = code
end

return export