Modul:External links/conf/Musikhenvisning

Page semibeskyttet
Fra Wikipedia, den frie encyklopædi
Documentation icon Moduldokumentation[vis] [redigér] [historik] [opfrisk]

Til opsæning af {{Musikhenvisninger}}

local function commons_formatter(id)
	return "https://commons.wikimedia.org/wiki/Category:" .. id:gsub(" ", "_")
end

local configured_claims = {}
configured_claims['da'] = {
	{ prop ='P373', message ="[$2 ''$1''] – bilder, video eller lyd på [[Wikimedia Commons]]", langcode = 'en', genitiv = false, url_f=commons_formatter },
        -- Kunstner
	{ prop='P8041',  message ="[$2 $1] på [[DR|DR musik]]", short="[$2 DR musikkunstner]", langcode ='en', genitiv = false },
	{ prop='P1728', message ="[$2 $1] på [[Allmusic]]", short="[$2 Allmusic]", langcode ='en', genitiv = false },
	{ prop='P1953',  message ="[$2 $1] på [[Discogs]]", short="[$2 Discogs]", langcode ='en', genitiv = false },
	{ prop='P434',  message ="[$2 $1] på [[MusicBrainz]]", short="[$2 MusicBrainz]", langcode ='en', genitiv = false },
	{ prop='P1952',  message ="[$2 $1] på [[Encyclopaedia Metallum]]", short="[$2 Encyclopaedia Metallum]", langcode ='en', genitiv = false },
	{ prop='P1989',  message ="[$2 $1] på [[Encyclopaedia Metallum]]", short="[$2 Encyclopaedia Metallum]", langcode ='en', genitiv = false },
        -- Udgivelser
	{ prop='P1729', message ="[$2 ''$1''] på [[Allmusic]]", short="[$2 Allmusic]", langcode ='en', genitiv = false },
	{ prop='P2206',  message ="[$2 ''$1''] på [[Discogs]]", short="[$2 Discogs]", langcode ='en', genitiv = false }, -- Utgivelse
	{ prop='P435',  message ="[$2 ''$1''] på [[MusicBrainz]]", short="[$2 MusicBrainz]", langcode ='en', genitiv = false }, --Utgivelse
	{ prop='P2721',  message ="[$2 ''$1''] på [[Encyclopaedia Metallum]]", short="[$2 Encyclopaedia Metallum]", langcode ='en', genitiv = false },
        -- Værker
	{ prop='P1994', message ="[$2 ''$1''] hos [[Allmusic]]", short="[$2 Allmusic]", langcode ='en', genitiv = false },
	{ prop='P1730', message ="[$2 ''$1''] hos [[Allmusic]]", short="[$2 Allmusic]", langcode ='en', genitiv = false },
	{ prop='P1954',  message ="[$2 ''$1''] på [[Discogs]]", short="[$2 Discogs]", langcode ='en', genitiv = false }, -- Verk
	{ prop='P6080',  message ="[$2 ''$1''] på [[Discogs]]", short="[$2 Discogs]", langcode ='en', genitiv = false }, -- Verk
	{ prop='P436',  message ="[$2 ''$1''] på [[MusicBrainz]]", short="[$2 MusicBrainz]", langcode ='en', genitiv = false }, --Verk
        -- Blandet P3192
	{ prop='P3192',  message ="[$2 $1] på [[Last.fm]]", short="[$2 Last.fm]", langcode ='en', genitiv = false }, --Verk
        -- Andet
	{ prop='P3265',  message ="[$2 $1] på [[Myspace]]", short="[$2 Myspace]", langcode ='en', genitiv = false }, --Verk
	{ prop='P2624',  message ="[$2 ''$1''] på [[MetroLyrics]]", short="[$2 MetroLyrics]", langcode ='en', genitiv = false },
	{ prop='P3435',  message ="[$2 ''$1''] på VGMdb", short="[$2 VGMdb]", langcode ='en', genitiv = false },
	{ prop='P3040',  message ="[$2 ''$1''] på [[SoundCloud]]", short="[$2 SoundCloud]", langcode ='en', genitiv = false },
}
local messages_conf = {}
messages_conf['da'] = {
	['short-list-separator'] = " '''·''' ",
	['no-data-cat'] = '[[Kategori:Artikler uden musikhenvisninger fra Wikidata]]',
	['with-data-cat'] = '[[Kategori:Artikler med musikhenvisninger fra Wikidata]]',
	['with-local-cat'] = '[[Kategori:Artikler med musikhenvisninger fra lokale verdier]]',
	['no-data-text'] = "''Artiklen har ingen egenskaber for musikdatabaser i Wikidata''",
	['no-wikilink'] = "''Artiklen mangler opslag i Wikidata''",
	['no-wikilink-cat'] = "[[Kategori:Artikler med musikhenvisninger og uden forbindelse til Wikidata]]",
	['track-cat-wd-wd'] = '[[Kategori:Artikler med musikhenvisninger 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