Currently, default labels don't appear on the global watchlist. Although they do show in the local watchlists on Wikidata.
Description
Details
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | Goal | Arian_Bozorg | T285156 [GOAL] Add termbox language code mul to reduce redundancy in Wikidata Labels and Aliases | ||
| Open | None | T312097 [EPIC] MUL - Default values for labels and aliases | |||
| Resolved | Release | Arian_Bozorg | T342278 [Milestone] v1.2 of the `mul` language code (www.wikidata.org) | ||
| Resolved | IKhitron | T373686 [MUL] Show default labels on the global watchlist | |||
| Resolved | BUG REPORT | IKhitron | T415306 Global Watchlist works wrong on Wikibase sites with items outside the main namespace | ||
| Resolved | BUG REPORT | IKhitron | T415337 Recognize Wikibase when no wgGlobalWatchlistWikibaseSite system variable is set |
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:
- Instead of API call for userLang, make it for userLang and for mul in the same call.
- If there is no value for userLang, use the value for mul, if exists.
- 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
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.
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
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.)
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)
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:
(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.)
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.)
Yes, it would be appropriate – if it did indeed match how the watchlist looks like. But it doesn’t:
- https://www.wikidata.org/w/api.php?action=wbformatentities&ids=Q31179608&uselang=bar shows a <sup>Deutsch</sup>, while the corresponding line on https://www.wikidata.org/wiki/Special:RecentChanges?uselang=bar doesn’t (nor would the watchlist I suppose, but I couldn’t test this properly while logged in due to my Babel settings mixing things up). For mul, the API doesn’t show the label either, but only for that one language.
- The watchlist/RC shows the entity ID in parentheses, the API endpoint 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()).
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 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
