Vés al contingut

Mòdul:Wikidades/i18n/eu

De la Viquipèdia, l'enciclopèdia lliure
-- Translations, local configuration and local specific functions

local function timeYearGenitive(year)
	local bc = string.sub(year, 1, 1) == '-'
	year = string.sub(year, 2)
	local year_suffix = '"ko"'
	if math.fmod(year, 20) == 1 or math.fmod(year, 20) == 10 or math.fmod(year, 20) == 5 or math.fmod(year, 20) == 15  or math.fmod(year, 200) == 100 then
		year_suffix = '"eko"'
	end
	return 'Y' .. year_suffix
end

-- Please translate to local language
local i18n = {
	["errors"] = {
		["property-not-found"] = "Propietatea ez da aurkitu.",
		["qualifier-not-found"] = "Kualifikatzailea ez da aurkitu.",
	},
	["datetime"] =
	{
		-- $1 is a placeholder for the actual number
		["beforenow"] = "duela $1",		-- how to format negative numbers for precisions 0 to 5
		["afternow"] = "$1 barru",		-- how to format positive numbers for precisions 0 to 5
		["bc"] = 'K. a. $1',			-- how print negative years
		["ad"] = "$1",					-- how print 1st century AD dates
		
		[0] = "$1 mila milioi urte",	-- precision: billion years
		[1] = "$100 milioi urte",		-- precision: hundred million years
		[2] = "$10 milioi urte",		-- precision: ten million years
		[3] = "$1 milioi urte",			-- precision: million years
		[4] = "$100000 urte",			-- precision: hundred thousand years; thousand separators added afterwards
		[5] = "$10000 urte",			-- precision: ten thousand years; thousand separators added afterwards
		[8] = "$1(e)ko hamarkada",		-- precision: decade
		-- the following use the format of #time parser function
		[6] = 'xrY". milurtekoa"',		-- precision: millennium
		[7] = 'xrY". mendea"',			-- precision: century
		[9]  = "Y",						-- precision: year
		[10] = function (ts)			-- precision: month
					-- format 'Y F' with year in genitive
					local year = string.match(ts, "([+-]%d+)")
					return timeYearGenitive(year) .. ' F'
				end,
		[11] = function (ts)			-- precision: day
					-- format 'Y F j' with declension suffixes
					local year, day = string.match(ts, "([+-]%d+)\-%d+\-(%d+)T") -- timestamp: "+1582-10-04T00:00:00Z"
					local day_suffix = '"a"'
					if day == '11' or day == '31' then
						day_suffix = ''
					end
					return timeYearGenitive(year) .. ' F"ren" j' .. day_suffix
				end,
	},
}

-- Functions for local grammatical cases
-- three dots syntax: ...=arg{}, arg[1]=lang, arg[2]=other
local cases = {
	["infoboxlabel"] = function(word) return require("Module:Wikidata/labels").fixInfoboxLabel(word) end,
}

return {
	i18n = i18n,
	cases = cases
}