Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Add 'lang' and 'dir' attributes to '.mwe-popups-extract' | mediawiki/extensions/Popups | master | +6 -2 |
Details
- Reference
- bz66114
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Dereckson | T68374 Enable Hovercards on se.wikimedia.org (Swedish chapter wiki) | |||
Resolved | Jdlrobson | T70860 [GOAL] Graduate Page Previews feature (Popups extension) out of Beta Feature | |||
Resolved | • Gilles | T70861 Performance review #2 of Hovercards (Popups extension) | |||
Resolved | phuedx | T149801 [EPIC] Refactor Hovercards (née Popups) | |||
Resolved | ovasileva | T156290 Merge mpga branch into master | |||
Resolved | ovasileva | T123445 Add support for RESTBase endpoint consumption | |||
Resolved | Fomafix | T68114 Hovercards: Add `lang` and `dir` attributes to the `.mwe-popups-extract` | |||
Resolved | Fomafix | T117392 Deliver page content language together with the extract |
Event Timeline
Change 142481 had a related patch set uploaded by Prtksxna:
Add lang and dir attributes to .mwe-popups-extract
Change 142481 had a related patch set uploaded (by Prtksxna):
Add 'lang' and 'dir' attributes to '.mwe-popups-extract'
The patch has a -1 but fix should be super simple. @Prtksxna are you able to do that and if not should someone feel free to take it over?
Change 142481 merged by jenkins-bot:
Add 'lang' and 'dir' attributes to '.mwe-popups-extract'
Can we use the current page's content language/direction for the popup instead of the one from the API? In which cases would that not work?
I am reopening the task because I want to switch the extension to use RESTBase and it currently doesn't return language details. It simple enough to add but I am want to find out why we need it before I request it.
In the MediaWiki namespace pages can have different languages. With $wgPageLanguageUseDB = true; every page can have an individual language.
For extracting the language code and the direction of the language from the current page see my comments on patch set 5: https://gerrit.wikimedia.org/r/#/c/142481/5/resources/ext.popups.core.js
Thanks @Fomafix! Do you know of any wikis (WMF or non-WMF) that use this extensively?
Thanks ! @GWicke was telling me (offline) that it should be easy to add, but we wanted some evidence of usage before cluttering the response.
@Prtksxna, this is now scheduled to be deployed tomorrow. Would the hovercards code temporarily tolerate responses without lang / dir attribute, or should we nuke the existing content?
Whoa! That was really quick. Hovercards hasn't even switched to the RESTBase response yet, and even when it does it should be fine if we don't get that content for a while. So, no need to nuke the existing content.
The changes are live in production. Here's an example: https://en.wikipedia.org/api/rest_v1/page/summary/Coca_Cola
However, we didn't drop all the data we've had in the storage, so now it will get updated to the new format gradually, as the articles are edited (also the response is cached for 1 hour, so update wouldn't be seen right away).