Jump to content

Module:R:sq:FGJSSH:1980

From Wiktionary, the free dictionary

This module implements the reference template {{R:sq:FGJSSH:1980}}.


local export = {}

function export.main(frame)

	local args = require("Module:parameters").process(frame:getParent().args, {
		[1] = { list = true },
		num = { list = true, allow_holes = true },
		sense = { list = true, allow_holes = true, alias_of = "num" },
		page = {}, pages = { alias_of = "page" },
		passage = {},
	})

	local terms = args[1]
	local nums = args.num or {}

	local expand_args = {
		title = "FGJSSH: Fjalor i gjuhës së sotme shqipe",
		["trans-title"] = "Dictionary of the modern Albanian language",
		year = "1980",
		url = "https://fjalori.shkenca.org",
		page = args.page,
		passage = args.passage,
	}

	if terms then
		local entry = ""
		local roman_numerals = {"i", "ii", "iii", "iv", "v"}
		for term_index, term in ipairs(terms) do
			if term_index > 1 then
				entry = entry .. "”, “"
			end
			entry = entry .. term
			if (nums[term_index]) then
				entry = entry
					.. [[ <span style="font-variant:small-caps;">]]
					.. roman_numerals[tonumber(nums[term_index])]
					.. "</span>"
			end
		end
		expand_args.chapter = entry
	end

	return frame:expandTemplate { title = "cite-book", args = expand_args }

end

return export