Modul:Wd/i18n: Forskjell mellom sideversjoner
< Modul:Wd
Ingen redigeringsforklaring |
m (Én sideversjon ble importert) |
||
(4 mellomliggende versjoner av 3 brukere er ikke vist) | |||
Linje 5: | Linje 5: | ||
function p.init(aliasesP) |
function p.init(aliasesP) |
||
p = { |
p = { |
||
["version"] = "7", -- increment this each time the below parameters are changed to avoid reference conflict errors |
|||
["errors"] = { |
["errors"] = { |
||
["unknown-data-type"] = "Ukjent eller ikke støttet datatype ' |
["unknown-data-type"] = "Ukjent eller ikke støttet datatype '%s'.", |
||
["missing-required-parameter"] = "Ingen påkrevde parametere definert, minst en er krevd", |
["missing-required-parameter"] = "Ingen påkrevde parametere definert, minst en er krevd", |
||
["extra-required-parameter"] = "Parameter ' |
["extra-required-parameter"] = "Parameter '%s' må definners om alternativ", |
||
["no-function-specified"] = "Du må definere en funksjon", -- equal to the standard module error message |
["no-function-specified"] = "Du må definere en funksjon", -- equal to the standard module error message |
||
["main-called-twice"] = 'Funkjsonen "main" kan ikke bli brukt to ganger', |
["main-called-twice"] = 'Funkjsonen "main" kan ikke bli brukt to ganger', |
||
["no-such-function"] = 'Funksjonen " |
["no-such-function"] = 'Funksjonen "%s" finnes ikke', -- equal to the standard module error message |
||
["no-such-reference-template"] = 'Error: template "%s", which is set in %s as the output template for the citation-output type "%s", does not exist', |
|||
⚫ | |||
-- Parts of the error message signalling a malformed reference. |
|||
["malformed-reference-header"] = "<span style=\"color:#dd3333\">\nError: Unable to display the reference from Wikidata properly. Technical details:\n", |
|||
⚫ | |||
["template-failure-reason"] = "* Reason for the failure of {{tl|%s}}: %s\n", |
|||
["missing-mandatory-param"] = 'The output template call would miss the mandatory parameter <code>%s</code>.', |
|||
["unknown-property-in-ref"] = 'The Wikidata reference contains the property {{property|%s}}, which is not assigned to any parameter of this template.' |
|||
}, |
}, |
||
["info"] = { |
["info"] = { |
||
Linje 55: | Linje 62: | ||
}, |
}, |
||
["cite"] = { |
["cite"] = { |
||
[" |
["output-types"] = {"web", "q"}, -- In this order, the output types will be tried |
||
[" |
["param-mapping"] = { |
||
["web"] = { |
|||
-- <= left side: all allowed reference properties for *web page sources* per https://www.wikidata.org/wiki/Help:Sources |
-- <= left side: all allowed reference properties for *web page sources* per https://www.wikidata.org/wiki/Help:Sources |
||
-- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite web]] (if non-existent, keep empty i.e. "") |
-- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite web]] (if non-existent, keep empty i.e. "") |
||
⚫ | |||
[aliasesP. |
[aliasesP.statedIn] = "nettside", |
||
[aliasesP. |
[aliasesP.referenceURL] = "url", |
||
[aliasesP. |
[aliasesP.publicationDate] = "dato", |
||
[aliasesP. |
[aliasesP.retrieved] = "besøksdato", |
||
[aliasesP. |
[aliasesP.title] = "tittel", |
||
[aliasesP. |
[aliasesP.archiveURL] = "arkiv-url", |
||
[aliasesP. |
[aliasesP.archiveDate] = "arkiv-dato", |
||
[aliasesP. |
[aliasesP.language] = "språk", |
||
[aliasesP. |
[aliasesP.author] = "etternavn", |
||
[aliasesP. |
[aliasesP.authorNameString] = "etternavn", |
||
[aliasesP. |
[aliasesP.publisher] = "utgiver", |
||
[aliasesP. |
[aliasesP.quote] = "sitat", |
||
[aliasesP. |
[aliasesP.pages] = "side", -- extra option |
||
⚫ | |||
⚫ | |||
}, |
|||
["q"] = { |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
[aliasesP.sectionVerseOrParagraph] = "seksjon", |
|||
⚫ | |||
⚫ | |||
[aliasesP.publicationDate] = "dato", |
|||
[aliasesP.retrieved] = "besøksdato" |
|||
} |
|||
}, |
}, |
||
[" |
["config"] = { |
||
-- supported fields: |
|||
⚫ | |||
-- - template: name of the template used for output |
|||
⚫ | |||
-- - numbered-params: citation params accepting an arbitrary number of values by numbering the params (e.g. author1, author2) |
|||
⚫ | |||
-- - raw-value-params: params taking a raw value (which means the property is rendered with getValue with raw=true) |
|||
⚫ | |||
-- - mandatory-params: params that are required be in the template call (after potentially appending numbers to params listed in numbered-params) |
|||
⚫ | |||
-- Leaving out the "template" field causes the output type to be ignored. |
|||
⚫ | |||
["web"] = { |
|||
⚫ | |||
["template"] = "Cite web", |
|||
⚫ | |||
[ |
["numbered-params"] = {"author"}, |
||
[ |
["mandatory-params"] = {"url"} |
||
}, |
|||
⚫ | |||
["q"] = { |
|||
["template"] = "Cite Q", |
|||
["raw-value-params"] = {"1"}, -- the first, unnamed parameter of CiteQ takes a QID, not the name of the item cited |
|||
["mandatory-params"] = {"1"} |
|||
} |
|||
} |
} |
||
} |
} |
Siste sideversjon per 27. feb. 2025 kl. 08:24
Dokumentasjon for denne modulen kan opprettes på Modul:Wd/i18n/dok
-- The values and functions in this submodule should be localized per wiki. local p = {} function p.init(aliasesP) p = { ["version"] = "7", -- increment this each time the below parameters are changed to avoid reference conflict errors ["errors"] = { ["unknown-data-type"] = "Ukjent eller ikke støttet datatype '%s'.", ["missing-required-parameter"] = "Ingen påkrevde parametere definert, minst en er krevd", ["extra-required-parameter"] = "Parameter '%s' må definners om alternativ", ["no-function-specified"] = "Du må definere en funksjon", -- equal to the standard module error message ["main-called-twice"] = 'Funkjsonen "main" kan ikke bli brukt to ganger', ["no-such-function"] = 'Funksjonen "%s" finnes ikke', -- equal to the standard module error message ["no-such-reference-template"] = 'Error: template "%s", which is set in %s as the output template for the citation-output type "%s", does not exist', -- Parts of the error message signalling a malformed reference. ["malformed-reference-header"] = "<span style=\"color:#dd3333\">\nError: Unable to display the reference from Wikidata properly. Technical details:\n", ["malformed-reference-footer"] = "See [[Module:wd/dok#References|the documentation]] for further details.\n</span>\n[[Category:Module:Wd reference errors]]", ["template-failure-reason"] = "* Reason for the failure of {{tl|%s}}: %s\n", ["missing-mandatory-param"] = 'The output template call would miss the mandatory parameter <code>%s</code>.', ["unknown-property-in-ref"] = 'The Wikidata reference contains the property {{property|%s}}, which is not assigned to any parameter of this template.' }, ["info"] = { ["edit-on-wikidata"] = "Rediger dette på Wikidata" }, ["numeric"] = { ["decimal-mark"] = ",", ["delimiter"] = " " }, ["datetime"] = { ["prefixes"] = { ["decade-period"] = "" }, ["suffixes"] = { ["decade-period"] = "-årene", ["millennium"] = " årtusen", ["century"] = " århundre", ["million-years"] = " millioner år", ["billion-years"] = " milliarder år", ["year"] = " år", ["years"] = " år" }, ["julian-calendar"] = "juliansk kalender", -- linked page title ["julian"] = "Juliansk", ["BCE"] = "f.Kr.", ["CE"] = "e.Kr.", ["common-era"] = "vår tidsregning" -- linked page title }, ["coord"] = { ["latitude-north"] = "N", ["latitude-south"] = "S", ["longitude-east"] = "Ø", ["longitude-west"] = "V", ["degrees"] = "°", ["minutes"] = "'", ["seconds"] = '"', ["separator"] = " " }, ["values"] = { ["unknown"] = "ukjent", ["none"] = "ingen" }, ["cite"] = { ["output-types"] = {"web", "q"}, -- In this order, the output types will be tried ["param-mapping"] = { ["web"] = { -- <= left side: all allowed reference properties for *web page sources* per https://www.wikidata.org/wiki/Help:Sources -- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite web]] (if non-existent, keep empty i.e. "") [aliasesP.statedIn] = "nettside", [aliasesP.referenceURL] = "url", [aliasesP.publicationDate] = "dato", [aliasesP.retrieved] = "besøksdato", [aliasesP.title] = "tittel", [aliasesP.archiveURL] = "arkiv-url", [aliasesP.archiveDate] = "arkiv-dato", [aliasesP.language] = "språk", [aliasesP.author] = "etternavn", [aliasesP.authorNameString] = "etternavn", [aliasesP.publisher] = "utgiver", [aliasesP.quote] = "sitat", [aliasesP.pages] = "side", -- extra option [aliasesP.publishedIn] = "website", [aliasesP.sectionVerseOrParagraph] = "at" }, ["q"] = { -- <= left side: all allowed reference properties for *sources other than web pages* per https://www.wikidata.org/wiki/Help:Sources -- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite Q]] (if non-existent, keep empty i.e. "") [aliasesP.statedIn] = "1", [aliasesP.pages] = "side", [aliasesP.column] = "på", [aliasesP.chapter] = "kapittel", [aliasesP.sectionVerseOrParagraph] = "seksjon", ["external-id"] = "id", -- used for any type of database property ID [aliasesP.title] = "tittel", [aliasesP.publicationDate] = "dato", [aliasesP.retrieved] = "besøksdato" } }, ["config"] = { -- supported fields: -- - template: name of the template used for output -- - numbered-params: citation params accepting an arbitrary number of values by numbering the params (e.g. author1, author2) -- - raw-value-params: params taking a raw value (which means the property is rendered with getValue with raw=true) -- - mandatory-params: params that are required be in the template call (after potentially appending numbers to params listed in numbered-params) -- Leaving out the "template" field causes the output type to be ignored. ["web"] = { ["template"] = "Cite web", ["numbered-params"] = {"author"}, ["mandatory-params"] = {"url"} }, ["q"] = { ["template"] = "Cite Q", ["raw-value-params"] = {"1"}, -- the first, unnamed parameter of CiteQ takes a QID, not the name of the item cited ["mandatory-params"] = {"1"} } } } } p.getOrdinalSuffix = function(num) return "." -- 1. 10. osv end p.addDelimiters = function(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 end return p