Modul:Wd/i18n
Udseende
< Modul:Wd
-- The values and functions in this submodule should be localized per wiki.
local p = {
["errors"] = {
["unknown-data-type"] = "Ukendt eller ikke-understøttet datatype '$1'.",
["missing-required-parameter"] = "Ingen krævede parametre er defineret, kræver mindst en",
["extra-required-parameter"] = "Parameteret '$1' skal defineres som valgfrit",
["no-function-specified"] = "Du skal angive en funktion, der skal kaldes", -- equal to the standard module error message
["main-called-twice"] = 'Funktionen "main" kan ikke kaldes to gange',
["no-such-function"] = 'Funktionen "$1" eksisterer ikke' -- equal to the standard module error message
},
["info"] = {
["edit-on-wikidata"] = "Redigér på Wikidata"
},
["numeric"] = {
["decimal-mark"] = ",",
["delimiter"] = "."
},
["datetime"] = {
["prefixes"] = {
["decade-period"] = "år "
},
["suffixes"] = {
["decade-period"] = "",
["millennium"] = " årtusind",
["century"] = " århundrede",
["million-years"] = " millioner år",
["billion-years"] = " milliarder år",
["year"] = " år",
["years"] = " år"
},
["julian-calendar"] = "Julianske kalender", -- linked page title
["julian"] = "Julian",
["BCE"] = "f.v.t.",
["CE"] = "CE",
["common-era"] = "Common Era" -- linked page title
},
["coord"] = {
["latitude-north"] = "N",
["latitude-south"] = "S",
["longitude-east"] = "E",
["longitude-west"] = "W",
["degrees"] = "°",
["minutes"] = "'",
["seconds"] = '"',
["separator"] = ", "
},
["values"] = {
["unknown"] = "ukendt",
["none"] = "ingen"
},
["cite"] = {
["url"] = "url", -- Cite web
["title"] = "title", -- Cite web
["website"] = "website", -- Cite web
["access-date"] = "access-date", -- Cite web
["archive-url"] = "archive-url", -- Cite web
["archive-date"] = "archive-date", -- Cite web
["author"] = "author", -- Cite web
["publisher"] = "publisher", -- Cite web
["quote"] = "quote", -- Cite web
["language"] = "language", -- Cite web
["date"] = "date", -- Cite web
["date-q"] = "date", -- Cite Q
["pages"] = "pages", -- Cite web
["pages-q"] = "pages", -- Cite Q
["chapter"] = "chapter" -- Cite Q
}
}
function p.getOrdinalSuffix(num)
if tostring(num):sub(-2,-2) == '1' then
return "." -- 10th, 11th, 12th, 13th, ... 19th
end
num = tostring(num):sub(-1)
if num == '1' then
return "."
elseif num == '2' then
return "."
elseif num == '3' then
return "."
else
return "."
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