Mòdul:External links/conf/Xarxes socials/proves

local configured_claims = {}

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

configured_claims['ca'] = {

    { prop='P2013', message='[$2 $1] a [[Facebook]]$3' },
	{ prop='P3267', message='[$2 $1] a [[Flickr]]$3' },
	{ prop='P2003', message='[$2 $1] a [[Instagram]]$3' },
	{ prop='P2002', message='[$2 $1] a [[Twitter]]$3' },
	{ prop='P3265', message='[$2 $1] a [[MySpace]]$3' },
	{ prop='P4015', message='[$2 $1] a [[Viemo]]$3' },

}

local messages_conf = {}

messages_conf['ca'] = {
	['short-list-separator'] = ', ',
	['with-data-cat']              = '[[Categoria:Articles using xarxes socials links with data from Wikidata]]',
	['no-data-text']               = "",
	['no-data-cat']                = '[[Categoria:Articles using xarxes socials links with no data in Wikidata]]',
	['no-wikilink']                = "''This article has no link in Wikidata''",
	['no-wikilink-cat']            = "[[Categoria:Articles using xarxes socials links with no link in Wikidata]]",
	['with-local-cat']             = '[[Categoria:Articles using xarxes socials links with local values]]',
	['track-cat-wd-wd']            = '[[Categoria:Articles using xarxes socials links with $1 from Wikidata]]',
	['track-cat-local-local']      = '[[Categoria:Articles using xarxes socials links with $1 from local value]]',
	['track-cat-wd-local']         = '[[Categoria:Articles using xarxes socials links with $1 from Wikidata but has local value]]',
	['track-cat-local-wd']         = '[[Categoria:Articles using xarxes socials links with $1 from local value but has Wikidata]]',
	['track-cat-local-wd-equal']   = "[[Categoria:Articles using xarxes socials links with $1 from local value same as Wikidata]]",
	['track-cat-local-wd-unequal'] = "[[Categoria:Articles using xarxes socials links with $1 from local value different from Wikidata]]",
}
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.getLimits (self)
	return limits
end

function p.getMessage (self, lang, msg)
	return messages_conf[lang][msg] 
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