Module:User:Victar/desctree2/templates

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


local export = {}

local m_languages = require("Module:languages")

function export.show(frame)
	local params = {
		 = {required = true, default = "la"},
		 = {required = true, default = "aqua"},
		 = {},
		 = {alias_of = "gloss"},
		 = {list = true},
		 = {},
		 = {},
		 = {},
		 = {},
		 = {},
		 = {},
		 = { boolean = true },
		 = { boolean = true },
		 = { boolean = true },
		 = {},
	}
	
	if frame.args then
		args = require("Module:parameters").process(frame.args, params)
	else
		args = require("Module:parameters").process(frame:getParent().args, params)
	end
	
	local lang = args
	local term = args
	local alt = args
	local sc = args
	
	if namespace == "Template" then
		if not sc and not lang then
			sc = "Latn"
		end
		if not lang then
			lang = "en"
		end
		if not term then
			term = "word"
		end
	end
	
	lang = m_languages.getByCode(lang)
		or require("Module:etymology languages").getByCode(lang)
		or m_languages.err(lang, 1)
		
	local entryLang = require("Module:etymology").getFull(lang)
	
	if lang:getCode() ~= entryLang:getCode() then
		-- ]
		require("Module:debug").track("descendant/etymological")
		require("Module:debug").track("descendant/etymological/" .. lang:getCode())
	end
	
	if sc then
		sc = require("Module:scripts").getByCode(sc) or error("The script code \"" .. sc .. "\" is not valid.")
	end
	
	local languageName = lang:getCanonicalName()
	languageName = mw.ustring.gsub(languageName, "^Proto%-", "")
	
	local descendants = require("Module:User:Victar/desctree2").getDescendants(entryLang, term)
	
	local alts = require("Module:User:Victar/desctree2").getAlternativeForms(entryLang, term)
	
	local link = require("Module:links").full_link(
		{
			lang = entryLang,
			sc = sc,
			term = args,
			alt = args,
			id = args,
			tr = args,
			genders = args,
			gloss = args,
			pos = args,
			lit = args,
		},
		nil,
		true
	)
	
	local arrow = ""
	if args then
		arrow = "→ "
	elseif args then
		arrow = "⇒ "
	end
	
	local prefix = ""
	if args then
		prefix = ""
	else
		prefix = table.concat{arrow, languageName, ": "}
	end
	
	local qual = ""
	if args then
		qual = " " .. require("Module:qualifier").format_qualifier(args)
	end
	
	return table.concat{prefix, link, alts, qual, descendants}
	
end

return export