模組:Documentation/functions/number list

return function (title, cats)
	local lang_code = title.fullText:match("^Module:Number list/data/(.+)")
	local lang = require("Module:languages").getByCode(lang_code)
	
	local function page_exists(title)
		local success, title_obj = pcall(mw.title.new, title)
		return success and title_obj.exists
	end
	
	if lang then
		local canonical_name = lang:getCanonicalName()
		local language_data_modules = canonical_name .. "資料模塊"
		
		cats:insert((page_exists("Category:" .. language_data_modules)
			and language_data_modules or canonical_name .. "模塊")
			.. "|number list")
		cats:insert("數字資料模塊|" .. canonical_name)
		
		return ("本-{zh-hans:模块;zh-hant:模組}-包含有關%s中各種類型數字的-{zh-hans:数据;zh-hant:資料}-。\n%s")
			:format(lang:makeCategoryLink(), require("Module:number list/show").table() or '')
	end
end