--[[SDcatModule to check whether local short description matches that on Wikidata--]]localp={}---------------------------------------------------------------------------------[[setCat has the qid of a Wikidata entity passed as |qid=(it defaults to the associated qid of the current article if omitted)and the local short description passed as |sd=It returns a category if there is an associated Wikidata entity.It returns one of the following tracking categories, as appropriate:* Category:Short description matches Wikidata (case-insensitive)* Category:Short description is different from Wikidata* Category:Short description with empty Wikidata descriptionFor testing purposes, a link prefix |lp= may be set to ":" to make the categories visible.--]]-- function exported for use in other modules-- (local short description, Wikidata entity-ID, link prefix)p._setCat=function(sdesc,itemID,lp)ifnotmw.wikibasethenreturnnilendifitemID==""thenitemID=nilend-- Wikidata description fieldlocalwdesc=(mw.wikibase.getDescription(itemID)or""):lower()ifwdesc==""thenreturn"[["..lp.."رده:شرح مختصر با شرح ویکیداده خالی]]"elseifwdesc==sdescthenreturn"[["..lp.."رده:شرح مختصر یکسان با ویکیداده]]"elsereturn"[["..lp.."رده:شرح مختصر متفاوت با ویکیداده]]"endend-- function exported for call from #invokep.setCat=function(frame)localargsifframe.args.sdthenargs=frame.argselseargs=frame:getParent().argsend-- local short descriptionlocalsdesc=mw.text.trim(args.sdor""):lower()-- Wikidata entity-IDlocalitemID=mw.text.trim(args.qidor"")-- link prefix, strip quoteslocallp=mw.text.trim(args.lpor""):gsub('"','')returnp._setCat(sdesc,itemID,lp)endreturnp