Module:request-forum

विक्षनरी से

"इस मॉड्यूल हेतु प्रलेख Module:request-forum/doc पर बनाया जा सकता है"

local export = {}

local standard_namespaces = {
	[""] = true,
	["Citations"] = true,
	["Reconstruction"] = true,
	["Transwiki"] = true,
}

local Sinitic_scripts = {
	["Bopo"] = true, -- Zhuyin
	["Hani"] = true, -- Han
	["Hans"] = true, -- Han (simplified)
	["Hant"] = true, -- Han (traditional)
	["Jpan"] = true, -- Japanese (general)
	["Hira"] = true, -- Hiragana
	["Kana"] = true, -- Katakana
	["Kore"] = true, -- Korean (general)
	["Hang"] = true, -- Hangul
	["Jurc"] = true, -- Jurchen
	["Kitl"] = true, -- Khitan large script
	["Kits"] = true, -- Khitan small script
	["Nshu"] = true, -- Nüshu
	["Shui"] = true, -- Sui
	["Tang"] = true, -- Tangut
}

local function subforum(lang_code, type)
	local namespace = mw.title.getCurrentTitle().nsText

	 -- RFDs of articles in nonstandard 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 type == "हटाने" and not standard_namespaces[namespace] then
		return "विक्षनरी:" .. type .. " हेतु अनुरोध/अन्य"
	elseif namespace == "Reconstruction" then
		-- There is no 'Requests for verification/Reconstruction'; everything vectors to RFDR.
		return "विक्षनरी:हटाने हेतु अनुरोध/Reconstruction"
	elseif lang_code == "hi" then
		return "विक्षनरी:" .. type .. " हेतु अनुरोध/हिंदी"
	end
	
	local lang = require("Module:languages").getByCode(lang_code, 1) -- print error if invalid code
	if lang:inFamily("jpx", "qfa-kor", "zhx") or Sinitic_scripts[lang:findBestScript(mw.title.getCurrentTitle().subpageText):getCode()] then
		return "विक्षनरी:" .. type .. " हेतु अनुरोध/CJK"
	elseif lang:inFamily("itc") then
		return "विक्षनरी:" .. type .. " हेतु अनुरोध/Italic"
	else
		return "विक्षनरी:" .. type .. " हेतु अनुरोध/ग़ैर-हिंदी"
	end
end

function export.rfv(frame)
	return subforum(frame.args[1], "सत्यापन")
end

function export.rfd(frame)
	return subforum(frame.args[1], "हटाने")
end

return export