-- Module to display an icon with a tooltip such as "Edit this at Wikidata".-- Icon will be linked to the Wikidata entry for the article where this is placed.-- This message is only displayed if a local_parameter is not supplied-- i.e. when called from a template, it can be coded not to display the message-- when a local parameter is in use, preventing the value form Wikidata being fetched.-- The qid of a Wikidata entry can optionally be supplied for testing outside the article.-- Usage:-- {{#invoke:EditAtWikidata|showMessage|local_parameter}}-- {{#invoke:EditAtWikidata|showMessage|qid=<ArticleID>|local_parameter}}localp={}locali18n={["message"]="Edit this at Wikidata"}p.showMessage=function(frame)-- There may be a local parameter supplied, if it's blank, set it to nillocallocal_parm=mw.text.trim(frame.args[1]or"")iflocal_parmand(local_parm=="")thenlocal_parm=nilend-- If there is a local parameter used, we don't want to display the messageiflocal_parmthenreturnnilend-- Can take a named parameter |qid which is the Wikidata ID for the article.-- This will not normally be used except for testing outside the article.localqid=frame.args.qidifqidand(qid=="")thenqid=nilend-- The module can take a parameter pid=-- which will create a link to that property in the Wikidata entry for the articlelocalpropertyID=mw.text.trim(frame.args.pidor"")-- Get the object containing all the claims for the articlelocalentity=mw.wikibase.getEntityObject(qid)ifentitythenlocalthisQidifqidthenthisQid=qidelsethisQid=entity.idend-- Named parameter nbsp allows replacing the leading space with localspaceifframe.args.nbspand(frame.args.nbsp~="")thenspace=" "elsespace=" "endreturnspace.."[[File:OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt="..i18n.message.." |link=https://www.wikidata.org/wiki/"..thisQid..(propertyID==""and""or("#"..propertyID)).."|"..i18n.message.."]]"endendreturnp