Modul:External links/conf/Musikk
Utseende
Moduldokumentasjon
[opprett]
local function commons_formatter(id)
return "https://commons.wikimedia.org/wiki/Category:" .. id:gsub(" ", "_")
end
local configured_claims = {}
configured_claims['nb'] = {
{ prop ='P373', message ="$3 [$2 ''$1''] – bilder, video eller lyd på [[Wikimedia Commons]]", langcode = 'en', genitiv = false, url_f=commons_formatter },
{ prop='P2206', message ="$3 [$2 ''$1''] på [[Discogs]]", short="[$2 Discogs]", langcode ='en', genitiv = false },
{ prop='P1954', message ="$3 [$2 ''$1''] på [[Discogs]]", short="[$2 Discogs]", langcode ='en', genitiv = false },
}
local messages_conf = {}
messages_conf['nb'] = {
['short-list-separator'] = " '''·''' ",
['no-data-cat'] = '[[Kategori:Artikler uten musikklenker fra Wikidata]]',
['with-data-cat'] = '[[Kategori:Artikler med musikklenker fra Wikidata]]',
['with-local-cat'] = '[[Kategori:Artikler med musikklenker fra lokale verdier]]',
['no-data-text'] = "''Artikkelen har ingen egenskaper for musikkdatabaser i Wikidata''",
['no-wikilink'] = "''Artikkelen mangler oppslag i Wikidata''",
['no-wikilink-cat'] = "[[Kategori:Artikler med musikklenker og uten kobling til Wikidata]]",
['track-cat-wd-wd'] = '[[Kategori:Artikler med musikklenker for $1 fra Wikidata]]',
['track-cat-local-local'] = '',
['track-cat-wd-local'] = '',
['track-cat-local-wd'] = '',
['track-cat-local-wd-equal'] = '',
['track-cat-local-wd-unequal'] = '',
}
local limits = {
['links-shown'] = 10, -- maximum number of links shown in the article.
}
local p = {}
function p.getConfiguredClaims (self, lang)
return configured_claims[lang]
end
function p.getMessage (self, lang, msg)
return messages_conf[lang][msg]
end
function p.getLimits (self)
return limits
end
-- metatable for the export
local mt = {
-- adjust the installation of the module
['__call'] = function (self, lang)
self.configured_claims = configured_claims[lang]
self.messages_conf = messages_conf[lang]
return self
end
}
-- install the metatable
setmetatable(p, mt)
return p