Page MenuHomePhabricator

Hovercards: Add `lang` and `dir` attributes to the `.mwe-popups-extract`
Closed, ResolvedPublic

Details

Reference
bz66114

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:11 AM
bzimport added a project: Page-Previews.
bzimport set Reference to bz66114.
bzimport added a subscriber: Unknown Object (MLST).
Prtksxna created this task.Jun 4 2014, 10:18 AM

Change 142481 had a related patch set uploaded by Prtksxna:
Add lang and dir attributes to .mwe-popups-extract

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

Prtksxna triaged this task as Low priority.Dec 3 2014, 2:54 AM
Prtksxna updated the task description. (Show Details)
Prtksxna set Security to None.
Prtksxna moved this task from Backlog to In Development on the Page-Previews board.Dec 3 2014, 5:34 AM
Prtksxna claimed this task.Dec 8 2014, 8:38 AM

Change 142481 had a related patch set uploaded (by Prtksxna):
Add 'lang' and 'dir' attributes to '.mwe-popups-extract'

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

Patch-For-Review

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?

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 29 2015, 9:50 PM
Jdlrobson changed the task status from Open to Stalled.Oct 9 2015, 12:55 AM

Does someone want to take over this patch as requested on gerrit?

Jdlrobson removed Prtksxna as the assignee of this task.Nov 2 2015, 3:53 PM
Fomafix claimed this task.Nov 4 2015, 2:57 PM
Jdlrobson changed the task status from Stalled to Open.Dec 17 2015, 8:26 PM

Change 142481 merged by jenkins-bot:
Add 'lang' and 'dir' attributes to '.mwe-popups-extract'

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

Jdlrobson closed this task as Resolved.Dec 17 2015, 9:01 PM

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.

Prtksxna reopened this task as Open.Jan 8 2016, 5:17 AM

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?

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?

Pchelolo added a subscriber: Pchelolo.EditedJan 13 2016, 1:29 AM

I've create a PR for RESTBase to add lang and dir properties to the summary endpoint response.

I've create a PR for RESTBase to add lang and dir properties to the summary endpoint response.

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?

@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.

@Prtksxna, it's hard to keep up with @Pchelolo ;)

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).

Prtksxna closed this task as Resolved.Jan 14 2016, 12:19 AM

Thanks @Pchelolo!