Page MenuHomePhabricator

[MUL] Show default labels on the global watchlist
Closed, ResolvedPublic

Description

Currently, default labels don't appear on the global watchlist. Although they do show in the local watchlists on Wikidata.

Event Timeline

@Arian_Bozorg, Danny is not available any more, at least for the foreseeable future. I'm trying to resolve some tasks of this extension, already did pretty lot. Could you explain please, with examples, what should be done here and how? Thank you.

Well, @Arian_Bozorg, you didn't answer for ten days, so I do it as I understand, right or wrong. Which is:

  1. Instead of API call for userLang, make it for userLang and for mul in the same call.
  2. If there is no value for userLang, use the value for mul, if exists.
  3. Enclose both possibilities with bdi tag, for the case they have opposite directions.

Change #1230261 had a related patch set uploaded (by IKhitron; author: IKhitron):

[mediawiki/extensions/GlobalWatchlist@master] Show default labels on the global watchlist

https://gerrit.wikimedia.org/r/1230261

Yes I believe that's correct @IKhitron

Great, thanks, working on it.

Test wiki created on Patch demo by IKhitron using patch(es) linked to this task:
https://91943c77fd.catalyst.wmcloud.org/w/

I wrote the draft, @Arian_Bozorg, and I'll test it by temporary replacing "mul" with some other language code. But I prefer to check it for real. Is there a way to add the default language to Patch Demo Wikibase? Thank you.

IKhitron changed the task status from Open to Stalled.Jan 23 2026, 6:47 AM

Will be reopened very soon, just after the fixes to T415306 and T415337: Recognize Wikibase when no wgGlobalWatchlistWikibaseSite system variable is set will be merged to the master branch.

@IKhitron looking at that Gerrit patch, I think you would probably be better off using the wbformatentities API instead of wbgetentities, so that Wikibase will do the language fallback for you – not just to mul but also to other fallback languages.

To enable mul on Patch Demo, I think you’d need to include a Gerrit change with the following diff:

diff --git i/repo/config/Wikibase.default.php w/repo/config/Wikibase.default.php
index 5503451d62..8b3eb10e36 100644
--- i/repo/config/Wikibase.default.php
+++ w/repo/config/Wikibase.default.php
@@ -450,7 +450,7 @@
 	 * adding it to the term language codes and falling back to it before the implicit 'en' fallback
 	 * @see https://phabricator.wikimedia.org/T312097
 	 */
-	'enableMulLanguageCode' => false,
+	'enableMulLanguageCode' => true,
 
 	/**
 	 * @note This config option is primarily added for the Wikidata transition use-case

@IKhitron looking at that Gerrit patch, I think you would probably be better off using the wbformatentities API instead of wbgetentities, so that Wikibase will do the language fallback for you – not just to mul but also to other fallback languages.

Thank you for your answer. I'll try this.

To enable mul on Patch Demo, I think you’d need to include a Gerrit change with the following diff:

diff --git i/repo/config/Wikibase.default.php w/repo/config/Wikibase.default.php
index 5503451d62..8b3eb10e36 100644
--- i/repo/config/Wikibase.default.php
+++ w/repo/config/Wikibase.default.php
@@ -450,7 +450,7 @@
 	 * adding it to the term language codes and falling back to it before the implicit 'en' fallback
 	 * @see https://phabricator.wikimedia.org/T312097
 	 */
-	'enableMulLanguageCode' => false,
+	'enableMulLanguageCode' => true,
 
 	/**
 	 * @note This config option is primarily added for the Wikidata transition use-case

Sorry, I don't understand. To add it where? We are talking about a temporary simulated wiki on Patch Demo. Isn't there another way?

You would create a Gerrit change with that diff (which I was too lazy to do) and then include it in the list of patches that are applied to the wiki. (For similar patches, see scoped typeahead search, namespace aliases, mobile editing UI.)

You would create a Gerrit change with that diff (which I was too lazy to do) and then include it in the list of patches that are applied to the wiki. (For similar patches, see scoped typeahead search, namespace aliases, mobile editing UI.)

I think we're talking about different things. The wiki is created automatically, I have no access to its repository. I'm not sure anyone has. I don't know exactly how this wiki is built, but looks like the files are just copied depending on different extensions. Maybe the original files for all the wikis can be updated, but I definetely can't do this. This is why I asked about another way. For example, set some system variable by api.

Change #1230920 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] DNM: Enable mul by default (for patchdemo)

https://gerrit.wikimedia.org/r/1230920

I don't know exactly how this wiki is built

When you create the wiki in patch demo, you select the Gerrit changes that should be applied to it. Here, you should select both the Gerrit change that you’re testing and the Gerrit change (which I’ve now created) that enables mul, like this:

image.png (222×754 px, 39 KB)

(I don’t think there’s a way to apply this change to an existing patch demo wiki – you’d have to create a new one.)

Ah, now I understand finally. Thank you, I'll try.

@IKhitron looking at that Gerrit patch, I think you would probably be better off using the wbformatentities API instead of wbgetentities, so that Wikibase will do the language fallback for you – not just to mul but also to other fallback languages.

Why wbformatentities? wbgetentities also has a languagefallback parameter.

wbformatentities has some other benefits, like formatting lexemes (which don’t have labels). But you’re right, wbgetentities + languagefallback would also be a good option. (Another characteristic of wbformatentities is that, at least in the HTML output format, it includes a language fallback indicator if appropriate; depending on the context I think this could be considered either a feature or an issue, but I think in a GlobalWatchlist context it would be appropriate, as it matches how the entity would be formatted on a local watchlist.)

Another characteristic of wbformatentities is that, at least in the HTML output format, it includes a language fallback indicator if appropriate; depending on the context I think this could be considered either a feature or an issue, but I think in a GlobalWatchlist context it would be appropriate, as it matches how the entity would be formatted on a local watchlist.

Yes, it would be appropriate – if it did indeed match how the watchlist looks like. But it doesn’t:

Is there a way to get really the same formatting out of Wikibase as what it uses on special pages? If yes, that would be great, but as long as there isn’t, I think wbgetentities is a better solution.

Interesting, I didn’t realize that. (The code seems to be in HtmlPageLinkRendererEndHookHandler::internalDoHtmlPageLinkRendererEnd() if I’m not mistaken.) Then I guess wbgetentities might be more appropriate (and GlobalWatchlist will have to add the lang= + dir= attributes itself; compare DefaultEntityLinkFormatter::getHtml()).

IKhitron triaged this task as Medium priority.
IKhitron moved this task from Potential to Gerrit WIP on the User-IKhitron board.
IKhitron changed the task status from Stalled to In Progress.Jan 29 2026, 4:03 PM
IKhitron raised the priority of this task from Medium to High.Feb 2 2026, 8:49 PM
IKhitron moved this task from Gerrit WIP to Ready to review on the User-IKhitron board.

Thank you for the feedback in the Gerrit, @Lucas_Werkmeister_WMDE. Indeed, looks like all your comments are about existing code, not the current change. All of it was written by Danny, not by me, and I'll need time to understand and to fix them. But I'll definitely check them out and try to write a new change in the foreseeable future with all you suggested. Possibly will create a new task for them and add you as subscriber.

Test wiki on Patch demo by IKhitron using patch(es) linked to this task was deleted:

https://91943c77fd.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by IKhitron using patch(es) linked to this task:
https://25ad8d221d.catalyst.wmcloud.org/w/

Change #1230261 merged by jenkins-bot:

[mediawiki/extensions/GlobalWatchlist@master] Show default labels on the global watchlist

https://gerrit.wikimedia.org/r/1230261

IKhitron moved this task from In review to Merged on the User-IKhitron board.