Module:gender and number: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 34: Line 34:
function export.show_list(frame)
function export.show_list(frame)
local args = frame.args
local args = frame.args
local lang_code = args["lang"]
local lang = require("Module:languages").get_by_code(args["lang"])
local pos = args["pos"]
local pos = args["pos"]
if lang_code == nil or lang_code == "" then
error("A language code must be given")
end
local genders = {}
local genders = {}
local i = 1
local i = 1
Line 46: Line 43:
i = i + 1
i = i + 1
end
end
 
local text, cats = export.format_genders(lang_code, pos, genders)
local text, cats = export.format_genders(lang, pos, genders)
return text .. cats
return text .. cats
end
end


function export.format_genders(lang_code, pos, genders)
function export.format_genders(language, pos, genders)
local language = require("Module:languages").get_by_code(lang_code)
local parts = {}
local parts = {}
local groups = {}
local groups = {}