Module:EditAtWikidata

Wikipedia, erkin enciklopediya

Bul moduldiń hújjetin Module:EditAtWikidata/doc betinde jarata alasız

-- Paydalanıw:
-- {{#invoke:EditAtWikidata|showMessage|local_parameter}}
-- {{#invoke:EditAtWikidata|showMessage|qid=<ArticleID|local_parameter}}

local p = {}

local i18n =
{
    ["message"] = "Bunı Wikimaǵlıwmatlarda redaktorlaw"
}

p.showMessage = function(frame)
	
	 
	local local_parm =  mw.text.trim(frame.args[1] or "")
	if local_parm and (#local_parm == 0) then local_parm = nil end
	
	 
	if local_parm then return nil end
	
	 
	local qid = frame.args.qid
	if qid and (#qid == 0) then qid = nil end
	
	 
	local propertyID = mw.text.trim(frame.args.pid or "")
	
	 
	local entity = mw.wikibase.getEntityObject(qid)
	if entity then
		local thisQid
		if qid then thisQid = qid else thisQid = entity.id end
		
		local icon
		if propertyID then
			icon = " [[File:Blue pencil.svg |frameless |text-top |10px |alt=" .. i18n.message .. " |link=https://www.wikidata.org/wiki/" .. thisQid .. "#" .. propertyID .. "|" .. i18n.message .. "]]"
		else
			icon = " [[File:Blue pencil.svg |frameless |text-top |10px |alt=" .. i18n.message .. " |link=https://www.wikidata.org/wiki/" .. thisQid .. "|" .. i18n.message .. "]]"
		end
		
		return icon
	end

end


return p