Pojdi na vsebino

Modul:WikidataGetCurrentId

Iz Wikipedije, proste enciklopedije
require "Modul:No globals"

local p = {}
local categoryCurrentId = '[[Kategorija: Članki z vpisom v Wikipodatkih]]';
local categoryNoCurrentId = '[[Kategorija: Članki brez vpisa v Wikipodatkih]]';

local function getEntityFromId(id)
	return mw.wikibase.getEntityObject(id)
end

function p.getCurrentId()
	local entity = getEntityFromId()
	if entity and entity.id ~= id then
		category = categoryCurrentId
	else
		category = categoryCurrentId
	end

	return entity and entity.id .. category;
end

return p