Module:languages/names/generate: Difference between revisions

From Laenkea
Jump to navigation Jump to search
No edit summary
Tag: Reverted
m (Maria moved page Module:languages/canonical names/generate to Module:languages/names/generate without leaving a redirect)
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
local export = {}
local export = {}


function export.show(frame)
function export.show()
local wrap_b = (frame.args["wrap"] and ("<" .. frame.args["wrap"] .. ">")) or ""
local wrap_e = (frame.args["wrap"] and ("</" .. frame.args["wrap"] .. ">")) or ""
local languages = require("Module:languages").languages
local ret = "return {"
local ret = "return {"
for k, v in ipairs(languages) do
local languages = mw.loadData("Module:languages/data")
ret = ret + '\n\t["' .. v.name .. '"] = "' .. v.code .. '",'
for k, v in pairs(languages) do
ret = ret .. '\n\t["' .. v.name .. '"] = "' .. v.code .. '",'
end
end
ret = ret .. "\n}"
ret = ret .. "\n}"
return wrap_b .. ret .. wrap_e
return ret
end
end


return export
return export

Latest revision as of 07:57, 6 August 2023

Generates up-to-date output that can be used to set the value of Module:languages/names.

Result

return {
	["Proto-Aegestic"] = "aeg-pro",
	["Middle Riyan"] = "ryn-m",
	["Kilitic"] = "kil",
	["Aegestian"] = "aeg",
	["Old Lusetian"] = "lus-o",
	["Old Aegestian"] = "aeg-o",
	["Radestrian"] = "rad",
	["Balavic"] = "bal",
	["Proto-Riyanic"] = "ryn-pro",
	["Riyan"] = "ryn",
	["Old Riyan"] = "ryn-o",
	["Lusetian"] = "lus",
	["Old Laefevian"] = "lfv-o",
	["Old Radestrian"] = "rad-o",
	["Ardian"] = "ard",
	["Old Ardian"] = "ard-o",
	["Proto-Radic"] = "rad-pro",
	["Translingual"] = "mul",
	["Middle Laefevian"] = "lfv-m",
	["Laefevian"] = "lfv",
	["Proto-Hirdic"] = "hrd-pro",
	["Proto-Laenkean"] = "lnk-pro",
	["Proto-Laefevic"] = "lfv-pro",
	["Middle Radestrian"] = "rad-m",
}

local export = {}

function export.show()
	local ret = "return {"
	local languages = mw.loadData("Module:languages/data")
	for k, v in pairs(languages) do
		ret = ret .. '\n\t["' .. v.name .. '"] = "' .. v.code .. '",'
	end
	ret = ret .. "\n}"
	return ret
end

return export