Page MenuHomePhabricator

Gallery RTL Text from Wikipedia Preview shows incorrect direction of LTR Text
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
hueitan
Aug 23 2021, 9:45 AM
Referenced Files
F34661613: image.png
Sep 29 2021, 3:59 PM
F34661608: image.png
Sep 29 2021, 3:59 PM
F34660396: image.png
Sep 28 2021, 11:44 AM
F34660261: image.png
Sep 28 2021, 9:52 AM
F34659548: Screenshot 2021-09-27 at 22.00.03.png
Sep 27 2021, 8:03 PM
F34659550: Screenshot 2021-09-27 at 21.59.52.png
Sep 27 2021, 8:03 PM
F34617687: image.png
Aug 23 2021, 9:46 AM
F34617685: image.png
Aug 23 2021, 9:46 AM

Description

Missing <bdi></bdi> tag for the text in Gallery

BeforeAfter (bdi)
image.png (605×347 px, 132 KB)
image.png (616×347 px, 133 KB)
image.png (613×352 px, 123 KB)
image.png (613×350 px, 122 KB)

Event Timeline

AMuigai changed the subtype of this task from "Task" to "Bug Report".
AMuigai moved this task from Backlog to Ready for Dev on the Inuka-Team (Kanban) board.
SBisson added a subscriber: SBisson.

The PR is merged

Jpita added a subscriber: Jpita.

I'm not sure this is a bug or a limitation of the sentence being in a LTR language shown as RTL.
This sentence is cut differently on RTL, starting from the end of the sentence instead of the beginning.

Is this ok or fixable?

RTLLTR
Screenshot 2021-09-27 at 22.00.03.png (278×1 px, 37 KB)
Screenshot 2021-09-27 at 21.59.52.png (236×1 px, 38 KB)

It's fixable and I think it should look like this

image.png (169×847 px, 77 KB)

@eamedina

I think I found another edge case, is that what's supposed to show or the description text?

commonspreviewcommons urltest article
image.png (528×2 px, 163 KB)
image.png (268×950 px, 231 KB)
https://commons.m.wikimedia.org/w/index.php?curid=35434198articles/arabic.html

I'd say this is a possible candidate for a new ticket where we could revisit how we source the image caption, but likely out of scope for this RTL/LTR ticket. Currently the code attempts to grab the caption from a couple of places, the caption landing in that image for example is from this api call:

https://ar.wikipedia.org/w/api.php?format=json&formatversion=2&origin=*&action=query&prop=imageinfo&iiextmetadatafilter=License|LicenseShortName|ImageDescription|Artist&iiextmetadatalanguage=ar&iiextmetadatamultilang=1&iiurlwidth=320&iiurlheight=568&iiprop=url|extmetadata&titles=%D9%85%D9%84%D9%81:Mosque_of_Amr_ibn_al-As.jpg