Module:request-forum

Go tswa ko Wiktionary

Documentation for this module may be created at Module:request-forum/doc

local export = {}

export.CJK = {}

-- Chinese
export.CJK["zh"] = true
export.CJK["och"] = true
export.CJK["ltc"] = true

-- Japonic
export.CJK["ja"] = true
export.CJK["ojp"] = true
export.CJK["ryu"] = true

-- Koreanic
export.CJK["ko"] = true
export.CJK["ko-ear"] = true
export.CJK["okm"] = true
export.CJK["oko"] = true
export.CJK["jje"] = true

function export.rfv(frame)
	local lang_code = frame.args[1]
	require("Module:languages").getByCode(lang_code, true) -- print error if invalid code
	
	local subforum
	if lang_code == "en" then
		subforum = "English"
	elseif export.CJK[lang_code] then
		subforum = "CJK"
	else
		subforum = "Non-English"
	end
	return "Wiktionary:Requests for verification/" .. subforum
end

function export.rfd(frame)
	local lang_code = frame.args[1]
	local namespace = frame.args[2]
	
	local subforum
	 -- RFDs of articles in "abnormal" namespaces go straight to [[WT:RFDO]] without having their language code checked.
	 -- This branch is only used by [[Template:rfd]] because the other RFD templates ([[Template:rfd-sense]], [[Template:rfd-redundant]]) semantically presuppose the target to be a lingual element.
	if namespace ~= nil and namespace ~= "" and namespace ~= "Citations" and namespace ~= "Reconstruction" and namespace ~= "Transwiki" then
		subforum = "Others"
	else
		require("Module:languages").getByCode(lang_code, true) -- print error if invalid code
		
		if lang_code == "en" then
			subforum = "English"
		elseif export.CJK[lang_code] then
			subforum = "CJK"
		else
			subforum = "Non-English"
		end
	end
	return "Wiktionary:Requests for deletion/" .. subforum
end

return export