A modult a Modul:number list/num2string/doc lapon tudod dokumentálni
local export = {}
local m_languages = require('Module:languages')
function export.get_number(frame)
local params = {
= {required = true},
= {required = true},
= { type = "boolean" },
}
local cur_type = "cardinal"
local args = require("Module:parameters").process(frame:getParent().args, params)
local lang = m_languages.getByCode(args)
if not lang then
return string.format('<strong class="error">Ismeretlen nyelvkód: %s</strong>', args)
end
local cur_num = args
cur_num = tonumber(cur_num)
local m_data = require("Module:number list/data/" .. lang:getCode())
local cur_data = m_data.numbers
if cur_data then
if cur_data then
local cur = cur_data
if args then
if type(cur) == "string" then
cur = { cur }
end
local m_translations = require("Module:translations")
for i, v in ipairs(cur) do
cur = m_translations.show_terminfo{
lang = lang,
term = v
}
end
return table.concat(cur, ', ')
else
return cur
end
else
return '<strong class="error">Ismeretlen a tőszámnévi alak</strong>'
end
else
return string.format(
'<strong class="error">Ismeretlen a(z) %d szám a(z) %s nyelvben</strong>',
cur_num,
lang:getCanonicalName()
)
end
end
return export