Thayts added a comment.
It would be convenient if there were a function or variable to get the
current wiki's site ID from, something like "`mw.site.siteId`".
On Wikipedia, I'm now trying to determine the site ID as follows, which is
not a 100% reliable way:
`siteId = (function() for i,v in pairs(mw.site.interwikiMap("local")) do if
v.isCurrentWiki and i~="w" then return mw.ustring.gsub(i,"-","_").."wiki" end
end end)()`
I need this in order to get the badges of the article on the current wiki
from the attached Wikidata entity object:
`entity.sitelinks[siteId].badges`
TASK DETAIL
https://phabricator.wikimedia.org/T182147
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Thayts
Cc: Thayts, Simon_Villeneuve, Pigsonthewing, Lea_Lacroix_WMDE, jberkel,
RolandUnger, Agabi10, RexxS, Vriullop, MisterSynergy, Ghuron, Uzume, putnik,
Jonas, aude, hoo, Ladsgroup, Tpt, thiemowmde, eranroz, Aklapper,
Lydia_Pintscher, darthmon_wmde, DannyS712, Nandana, Lahi, Gq86,
GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Wikidata-bugs,
Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs