Jump to content

Module:Finditem

Gikan sa Wikipedia, ang gawasnong ensiklopedya

Documentation for this module may be created at Module:Finditem/doc

local p = {}
local i18n = 
	{
		["noentity"] = "[[Kategoriya:Articles without Wikidata item]]",
	
	}

function p.find(frame)
	if mw.title.getCurrentTitle().namespace ~= 0
	then
		return ''
	end
	local entity = mw.wikibase.getEntityObject()
	if frame.args[1] == nil 
		then er = i18n.noentity
		else er = frame.args[1]
	end
	P17track = (entity and entity.claims and entity.claims["P17"]) and '' or '[[Kategoriya:Country not in Wikidata]]'
	P31track = (entity and entity.claims and entity.claims["P31"]) and '' or '[[Kategoriya:Instance of not in Wikidata]]'
	P625track = (entity and entity.claims and entity.claims["P625"]) and '' or '[[Kategoriya:Coordinates not on Wikidata]]'
	P1566track = (entity and entity.claims and entity.claims["P1566"]) and '' or '[[Kategoriya:GeoNames ID not in Wikidata]]'
	if entity 
	then
		return P17track .. P31track .. P625track .. P1566track
	else
	-- This is the place to insert a category for articles that don't have items in Wikidata.
	-- enwiki doesn't seem to have such a category, so in this case it is empty.
	-- For other wikis, just remove the two comment dashes and insert the correct category name.
		return er
	end
end
return p