Modul:Wd/i18n

Üdvözlöm, Ön a Modul:Wd/i18n szó jelentését keresi. A DICTIOUS-ban nem csak a Modul:Wd/i18n szó összes szótári jelentését megtalálod, hanem megismerheted az etimológiáját, a jellemzőit és azt is, hogyan kell a Modul:Wd/i18n szót egyes és többes számban mondani. Minden, amit a Modul:Wd/i18n szóról tudni kell, itt található. A Modul:Wd/i18n szó meghatározása segít abban, hogy pontosabban és helyesebben fogalmazz, amikor beszélsz vagy írsz. AModul:Wd/i18n és más szavak definíciójának ismerete gazdagítja a szókincsedet, és több és jobb nyelvi forráshoz juttat.

A modult a Modul:Wd/i18n/doc lapon tudod dokumentálni

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

local p = {}

function p.init(aliasesP)
	p = {
		 = {
			          = "Unknown or unsupported datatype '$1'.",
			 = "No required parameters defined, needing at least one",
			   = "Parameter '$1' must be defined as optional",
			      = "You must specify a function to call",  -- equal to the standard module error message
			          = 'The function "main" cannot be called twice',
			           = 'The function "$1" does not exist',  -- equal to the standard module error message
                    = "Error: Unable to display the reference properly. See ] for details.]"
		},
		 = {
			 = "Edit this on Wikidata"
		},
		 = {
			 = ".",
			    = ","
		},
		 = {
			 = {
				 = ""
			},
			 = {
				 = "s",
				    = " millennium",
				       = " century",
				 = " million years",
				 = " billion years",
				          = " year",
				         = " years"
			},
			 = "Julian calendar",  -- linked page title
			          = "Julian",
			             = "BCE",
			              = "CE",
			      = "Common Era"  -- linked page title
		},
		 = {
			 = "N",
			 = "S",
			 = "E",
			 = "W",
			        = "°",
			        = "'",
			        = '"',
			      = ", "
		},
		 = {
			 = "unknown",
			    = "none"
		},
		 = {
			 = "5",  -- increment this each time the below parameters are changed to avoid conflict errors
			 = {
				-- <= left side: all allowed reference properties for *web page sources* per https://www.wikidata.orghttps://dictious.com/hu/Help:Sources
				-- => right side: corresponding parameter names in (equivalent of) ] (if non-existent, keep empty i.e. "")
				                = "website",
				            = "url",
				         = "date",
				               = "access-date",
				                   = "title",
				              = "archive-url",
				             = "archive-date",
				                = "language",
				                  = "author",  -- existence of author1, author2, author3, etc. is assumed
				        = "author",
				               = "publisher",
				                   = "quote",
				                   = "pages",  -- extra option
				             = "website",
				 = "at"
			},
			 = {
				-- <= left side: all allowed reference properties for *sources other than web pages* per https://www.wikidata.orghttps://dictious.com/hu/Help:Sources
				-- => right side: corresponding parameter names in (equivalent of) ] (if non-existent, keep empty i.e. "")
				                = "1",
				                   = "pages",
				                  = "at",
				                 = "chapter",
				 = "section",
				                    = "id",  -- used for any type of database property ID
				                   = "title",
				         = "date",
				               = "access-date"
			}
		}
	}

	p.getOrdinalSuffix = function(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

	p.addDelimiters = function(n)
		local left, num, right = string.match(n, "^(*%d)(%d*)(.-)$")

		if left and num and right then
			return left .. (num:reverse():gsub("(%d%d%d)", "%1" .. p):reverse()) .. right
		else
			return n
		end
	end

	return p
end

return p