Module:reference template cat

Hello, you have come here looking for the meaning of the word Module:reference template cat. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:reference template cat, but we will also tell you about its etymology, its characteristics and you will know how to say Module:reference template cat in singular and plural. Everything you need to know about the word Module:reference template cat you have here. The definition of the word Module:reference template cat will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:reference template cat, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

Template:R:ps:NEVP
{{reference template cat|ira-pro|title=Template:R:ps:NEVP}}
[[Category:Pashto reference templates|NEVP]][[Category:Proto-Iranian reference templates|NEVP]]
Template:R:ine:LIV
{{reference template cat|title=Template:R:ine:LIV}}
[[Category:Proto-Indo-European reference templates|LIV]]
Template:R:bat:EDBIL
{{reference template cat|ine-bsl-pro|lv|lt|title=Template:R:bat:EDBIL}}
[[Category:Proto-Balto-Slavic reference templates|EDBIL]][[Category:Latvian reference templates|EDBIL]][[Category:Lithuanian reference templates|EDBIL]]
Template:R:ine:LIV
{{reference template cat|ine-bsl-pro|lv|lt|sort=Rix, Helmut|title=Template:R:ine:LIV}}
[[Category:Proto-Indo-European reference templates|Rix, Helmut]][[Category:Proto-Balto-Slavic reference templates|Rix, Helmut]][[Category:Latvian reference templates|Rix, Helmut]][[Category:Lithuanian reference templates|Rix, Helmut]]

local export = {}

local Array = require("Module:array")
local m_lang = require("Module:languages")

local prefixes = {
	 = 'R',
	 = 'RQ',
}

function export.categorize(title, langs, sortkey, what)
	what = what or 'reference';
	langs = Array(langs):slice()
	local name = title.text:gsub("^" .. prefixes .. ":", "")
	local lang_in_title, rest = name:match("^(%l*%l):(.+)$")
	if lang_in_title then
		if not m_lang.getByCode(lang_in_title) then
			lang_in_title = lang_in_title .. "-pro"
		end
		
		if m_lang.getByCode(lang_in_title) and not langs:contains(lang_in_title) then
			langs:insert(1, lang_in_title)
		end
		
		name = rest
	end
	
	sortkey = sortkey or name
	
	return langs
		:map(
			function (langCode)
				local lang = m_lang.getByCode(langCode, true)
				return "[[Category:" .. lang:getCanonicalName()
					.. " " .. what .. " templates|" .. sortkey .. "]]"
			end)
		:concat ""
end

function export.main(frame)
	local current_title = mw.title.getCurrentTitle()
	if current_title.nsText == "" or current_title.nsText == "Reconstruction" then
		error("This template is meant to be used in the Template namespace.")
	end

	local what = frame.args.what or 'reference'; -- can be either 'reference' or 'quotation'
	
	local args = frame:getParent().args
	
	local sortkey = args.sort
	
	local args = Array.shallowCopy(args)
	local title = current_title
	local is_demo = current_title.nsText == "Module"
		or (current_title.nsText == "Template"
		and current_title.baseText == what .. " template cat")
	if is_demo and args.title then
		title = mw.title.new(args.title)
		args.title = nil
	end
	
	args.sort = nil
	
	local langs = args
	if not langs:is_array() then
		error("Sequential positional parameters expected")
	end
	
	local categories = export.categorize(title, langs, sortkey, what)
	if is_demo then
		categories = mw.text.nowiki(categories)
	end
	
	return categories
end

return export