Module:EditAtWikidata
Bu modul uchun Module:EditAtWikidata/doc nomli hujjat sahifasini yaratishingiz mumkin
-- Foydalanish:
-- {{#invoke:EditAtWikidata|showMessage|local_parameter}}
-- {{#invoke:EditAtWikidata|showMessage|qid=<ArticleID|local_parameter}}
local p = {}
local i18n =
{
["message"] = "Buni Vikimaʼlumotlarda tahrirlash"
}
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 = " [[Fayl:Blue pencil.svg |frameless |text-top |10px |alt=" .. i18n.message .. " |link=https://www.wikidata.org/wiki/" .. thisQid .. "#" .. propertyID .. "|" .. i18n.message .. "]]"
else
icon = " [[Fayl: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