Pojdi na vsebino

Modul:WikidataGetCurrentId

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

local p = {}
local categoryNoWikidataId = '[[Kategorija: Objekta ni vpisanega v Wikipodatkih]]';

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

function p.getCurrentId()
	local entity = getEntityFromId()
	if entity then
		return nil
	else
		return entity and entity.id .. categoryNoWikidataId
	end
end

return p