Modul:Wd/i18n

Vu Wikipedia
Op d'Navigatioun wiesselen Op d'Siche wiesselen

D'Dokumentatioun fir dëse Modul kann op Modul:Wd/i18n/doc ugeluecht ginn

-- The values and functions in this submodule should be localized per wiki.

local p = {
	["errors"] = {
		["unknown-data-type"]          = "Unknown or unsupported datatype '$1'.",
		["missing-required-parameter"] = "No required parameters defined, needing at least one",
		["extra-required-parameter"]   = "De Parameter '$1' muss als fakultativ definéiert ginn",
		["no-function-specified"]      = "Dir musst eng Funktioun uginn déi opgeruff gi soll",  -- equal to the standard module error message
		["main-called-twice"]          = 'D Funktioun "main" kann net zweemol opgeruff ginn',
		["no-such-function"]           = 'D Funktioun "$1" gëtt et net'  -- equal to the standard module error message
	},
	["info"] = {
		["edit-on-wikidata"] = "Ännert dëst op Wikidata"
	},
	["numeric"] = {
		["decimal-mark"] = ",",
		["delimiter"]    = "."
	},
	["datetime"] = {
		["prefixes"] = {
			["decade-period"] = ""
		},
		["suffixes"] = {
			["decade-period"] = "s",
			["millennium"]    = " Joerdausend",
			["century"]       = " Joerhonnert",
			["million-years"] = " million years",
			["billion-years"] = " billion years",
			["year"]          = " Joer ",
			["years"]         = " Joer"
		},
		["julian-calendar"] = "Julian calendar",  -- linked page title
		["julian"]          = "Julian",
		["BCE"]             = "BCE",
		["CE"]              = "CE",
		["common-era"]      = "Common Era"  -- linked page title
	},
	["coord"] = {
		["latitude-north"] = "N",
		["latitude-south"] = "S",
		["longitude-east"] = "O",
		["longitude-west"] = "W",
		["degrees"]        = "°",
		["minutes"]        = "'",
		["seconds"]        = '"',
		["separator"]      = ", "
	},
	["values"] = {
		["unknown"] = "onbekannt",
		["none"]    = "keng"
	},
	["cite"] = {
		["cite-web"]     = "Cite web",  -- title of template equivalent to [[:en:Template:Cite web]], leave empty (i.e. "") to use default rendering
		["cite-q"]       = "Cite Q",  -- title of template equivalent to [[:en:Template:Cite Q]], leave empty (i.e. "") to use default rendering
		["url"]          = "url",
		["title"]        = "title",
		["website"]      = "website",
		["date"]         = "Datum",
		["access-date"]  = "access-date",
		["archive-url"]  = "archive-url",
		["archive-date"] = "archive-date",
		["author"]       = "Auteur",
		["publisher"]    = "publisher",
		["quote"]        = "quote",
		["language"]     = "Sprooch",
		["pages"]        = "Säiten",
		["chapter"]      = "Kapitel"
	}
}

function p.getOrdinalSuffix(num)
	if tostring(num):sub(-2,-2) == '1' then
		return "th"  -- 10th, 11th, 12th, 13th, ... 19th
	end
	
	num = tostring(num):sub(-1)
	
	if num == '1' then
		return "st"
	elseif num == '2' then
		return "nd"
	elseif num == '3' then
		return "rd"
	else
		return "th"
	end
end

function p.addDelimiters(n)
	local left, num, right = string.match(n, "^([^%d]*%d)(%d*)(.-)$")
	
	if left and num and right then
		return left .. (num:reverse():gsub("(%d%d%d)", "%1" .. p['numeric']['delimiter']):reverse()) .. right
	else
		return n
	end
end

return p