I reviewed the current situation with the "Donate" link in the sidebar of Wikimedia wikis, which is controlled with sitesupport-url.
- The default sidebar, defined by wikimedia-sidebar in WikimediaMessages, has an item with a link to sitesupport-url. Wikis often customise [[MediaWiki:Sidebar]], copying this list item. This is used by most skins.
- WikimediaMessages has a hook which, if $wgWikimediaMessagesAnonDonateLink is true, fetches sitesupport-url and adds a link to it in the user-page section.
- The Minerva skin has insertDonateItem(), which fetches the sitesupport-url message and appends utm_key=minerva to it.
- In WikimediaMessages, there is a default sitesupport-url which goes to https://donate.wikimedia.org/?utm_source=donate&utm_medium=sidebar&utm_campaign=spontaneous&uselang=en
- The documentation indicates that translators are expected to copy this message and replace the uselang parameter with their own language code. Some have done so.
- In addWiki.php in WikimediaMaintenance, the sitesupport-url for new wikis is overridden by writing https://donate.wikimedia.org/?utm_source=donate&utm_medium=sidebar&utm_campaign=$domain&uselang=$wgContLang to [[MediaWiki:Sitesupport-url]].
- Many (most?) wikis have customised [[MediaWiki:Sitesupport-url]], setting it to something like https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_en.wikipedia.org&uselang=en, a 2013 hack implemented by staff as noted in T136134.
The drawbacks of this situation are:
- It is non-trivial to change the donate link. All these places would have to be changed, including editing every wiki.
- The uselang parameter generally reflects the content language of the source wiki. Sidebar URLs are fetched from the content language so translation of the sitesupport-url message in WikimediaMessages is not effective.
- The utm_campaign parameter is not consistent.
- There is code in addWiki.php which I want to remove to make T352113 simpler.
Proposal:
- In WikimediaMessages en.json, set sitesupport-url to https://donate.wikimedia.org/?utm_source=donate&utm_medium=sidebar&utm_campaign={{SERVERNAME}}&uselang={{USERLANGUAGE}}. I tested this locally, the variables are expanded. For sidebar links, {{USERLANGUAGE}} is always the content language, but for Minerva and $wgWikimediaMessagesAnonDonateLink links, it is the user language, if $wgParserEnableUserLanguage is true.
- In WikimediaMessages qqq.json, set sitesupport-url to {{notranslate}} and delete the existing translations.
- Remove the addWiki.php code.
- Delete all the [[MediaWiki:Sitesupport-url]] pages.