模組:section langue

來自維基辭典

呢個模組嘅解說可以喺模組:section langue/doc度開

local p = {}
local m_languages = require("Module:languages")

function p.main(frame)
	local args = frame:getParent().args
	if args[1] == nil or args[1] == "" then
		return "<span class=\"error\">langue模出錯:無提供語言代碼</span>"
	end
	local lang = m_languages.getByCode(args[1]) or m_languages.err(args[1], 1)
	return lang:getCanonicalName() .. "[[Category:" .. lang:getCanonicalName() .. "]]"
end

return p