Module:User:Erutuon/t-simple

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

{{t-simple|la|nasus|alt=nāsus|langname=Latin}}


local export = {}

function export.show(frame)
	local params = {
		 = { required = true }, -- language code
		 = { required = true }, -- term
		 = { alias_of = "g" }, -- gender
		g = { list = true },
		alt = {}, -- displayed text
		tr = {}, -- transliteration
		lit = {}, -- literal translation
		id = {}, -- sense id
	}
	
	local args = require "Module:parameters".process(frame.args, params, true)
	
	local lang = require "Module:languages".getByCode(args)
		or require "Module:languages".err(args, 1)
	
	local output = require "Module:array" "{{t-simple"
	
	local alt = args.alt
	if not alt then
		entry_name = lang:makeEntryName(args)
		if entry_name ~= args then
			args, alt = entry_name, args
		end
	end
	
	for _, param in ipairs {
		{ 1, lang:getCode() },
		{ 2, args },
		{ "alt", alt },
		{ "sc", args.sc },
		{ "g", args.g },
		{ "tr", args.tr },
		{ "langname", lang:getCanonicalName() },
	} do
		local key, value = unpack(param)
		if value then
			if type(key) == "number" then
				output:insert("|" .. value)
			else
				output:insert("|" .. key .. "=" .. value)
			end
		end
	end
	
	output:insert "}}"
	
	return output:concat()
end

return export