Module:languages/names/generate
< Module:languages | names
Jump to navigation
Jump to search
Generates up-to-date output that can be used to set the value of Module:languages/names.
Result
<strong class="error"><span class="scribunto-error" id="mw-scribunto-error-0">Lua error at line 6: attempt to get length of local 'languages' (a nil value).</span></strong>
local export = {}
function export.show()
local languages = require("Module:languages").languages
local ret = "return {"
ret = ret .. '\n["num"] = ' .. #languages .. ","
ret = ret .. '["test"] = ' .. languages[1] .. ","
for k, v in ipairs(languages) do
ret = ret .. '\n\t["' .. v.name .. '"] = "' .. v.code .. '",'
end
ret = ret .. "\n}"
return ret
end
return export