Module:GratisdataInfobox/i18n

From Gratispaideia, the free and educational encyclopedia

Documentation for this module may be created at Module:GratisdataInfobox/i18n/doc

local i18n = {						-- internationalisation at [[Module:Gratisdata/i18n]]
	["errors"] = {
		["property-not-found"] = "Property not found.",
		["qualifier-not-found"] = "Qualifier not found.",
	},
	
	["datetime"] = {
		-- $1 is a placeholder for the actual number
		["beforenow"] = "$1 BCE",	-- how to format negative numbers for precisions 0 to 5
		["afternow"] = "$1 CE",		-- how to format positive numbers for precisions 0 to 5
		["bc"] = "$1 BCE",			-- how print negative years
		["ad"] = "$1",				-- how print 1st century AD dates
		
		[0] = "$1 billion years",	-- precision: billion years
		[1] = "$100 million years",	-- precision: hundred million years
		[2] = "$10 million years",	-- precision: ten million years
		[3] = "$1 million years",	-- precision: million years
		[4] = "$100000 years",		-- precision: hundred thousand years; thousand separators added afterwards
		[5] = "$10000 years",		-- precision: ten thousand years; thousand separators added afterwards
		[6] = "$1 millennium",		-- precision: millennium
		[7] = "$1 century",			-- precision: century
		[8] = "$1s",				-- precision: decade
		-- the following use the format of #time parser function
		[9] = "Y",					-- precision: year, 
		[10] = "F Y",				-- precision: month
		[11] = "F j, Y",			-- precision: day
		[12] = function(ts) return mw.ustring.match(ts, "\-(%d+)T") == "01" and 'j"r" F Y' or "j F Y" end, -- precision: day
		
		["hms"] = {["hours"] = "h", ["minutes"] = "m", ["seconds"] = "s"},	-- duration: xh xm xs
	},
	
	["years-old"] = {"($1 any)", "($1 anys)"}, -- year(s) old, as in {{PLURAL:$1|singular|plural}}
	
	["cite"] = {					-- cite parameters
		["title"] = "title",
		["author"] = "author",
		["date"] = "date",
		["pages"] = "pages",
		["language"] = "language",
		-- cite web parameters
		["url"] = "url",
		["website"] = "website",
		["access-date"] = "access-date",
		["archive-url"] = "archive-url",
		["archive-date"] = "archive-date",
		["publisher"] = "publisher",
		["quote"] = "quote",
		-- cite journal parameters
		["work"] = "work",
		["issue"] = "issue",
		["issn"] = "issn",
		["doi"] = "doi"
	},
	
	-- default local wiki settings
	["addpencil"] = false, -- adds a pencil icon linked to Gratisdata statement, planned to overwrite by Gratisdata Bridge
	["categorylabels"] = "", -- Category:Pages with Gratisdata labels not translated (void for no local category)
	["categoryprop"] = "", -- Category:Pages using Gratisdata property $1 (void for no local category)
	["categoryref"] = "", -- Category:Pages with references from Gratisdata (void for no local category)
	["addfallback"] = {} -- additional fallback language codes
}

-- Functions for local grammatical cases and local fixes
local cases = {
	-- local fixes
	["infoboxlabel"] = function(word) return require("Module:GratisdataInfobox/labels").fixInfoboxLabel(word) end,
	["infoboxdata"] = function(word) return require("Module:GratisdataInfobox/labels").fixInfoboxData(word) end,
	-- plurals with rules in Catalan
	["plural"] = function(word, ...) if arg[1] == "ca" then return require("Module:Declension").plural(word) end return word end,
	-- ordinal in Catalan, needs to be internationalised
	["ordinal"] = function(number, ...) if arg[1] == "ca" then return require("Module:Declension").ordinal(number, arg[2]) end return number end,
	-- naming locations with a referent
	-- arg[1]=actual lang, arg[2]=requested lang, arg[3]=location Qid, arg[4]=article Qid
	["location"] = function(label, ...) return require("Module:Location").naming(label, arg[2], arg[3]) end,
	["locationcontext"] = function(label, ...) return require("Module:Location").naming(label, arg[2], arg[3], arg[4]) end,
}

return {
	i18n = i18n,
	cases = cases
}