Module:topics

Revision as of 10:16, 7 August 2023 by Maria (talk | contribs) (Created page with "local export = {} local m_languages = require("Module:languages") function export.show(frame) local args = frame:getParent().args local language = m_languages.get_by_code(args[1]) local cats = "" local i = 2 while args[i] do cats = cats .. "[[Category:" .. language.code .. ":" .. args[i] .. "]]" i = i + 1 end if cats == "" then error("at least 1 topic must be supplied to {{topic}}") end return cats end return export")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:topics/documentation

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

function export.show(frame)
	local args = frame:getParent().args
	local language = m_languages.get_by_code(args[1])
	local cats = ""
	local i = 2
	while args[i] do
		cats = cats .. "[[Category:" .. language.code .. ":" .. args[i] .. "]]"
		i = i + 1
	end
	if cats == "" then
		error("at least 1 topic must be supplied to {{topic}}")
	end
	return cats
end

return export