Page MenuHomePhabricator

RTL display is flipped
Closed, ResolvedPublic

Description

see
https://he.wikipedia.beta.wmflabs.org/wiki/User:קיפודנחש1/ChessBrowser_test_cases

note that the buttons, file legends (if you can't read hebrew: "א" is a, ח is h), and pieces positions are mirrored left/right.

guessing some @noflip markers needed in CSS.

peace

Event Timeline

can you make screenshots of what it looks like and how it should like ? That makes interpretation a lot easier...
And is this a new issue, or was it already like that for a while but no one noticed ?

@TheDJ: I can help with that.

Currently looks like this:

image.png (552×578 px, 32 KB)

How it should look like (ignore the positioning of chess pieces, I manipulated the CSS to fix the edge numbers and letters but did not do a great job):

image.png (556×592 px, 34 KB)

So the point is: everything is flipped along a vertical axis.

Well I can easily hardcode the direction to ltr for the checkerboard, that fixes the legend…. But apparently not the piece position. That can be for various reasons, I’ll have to check if it’s because they are calculated only once…..

@TheDJ Objects on the board are positioned using classes which define rows and columns. When the language is RTL, the CSS seems to index the "left" attribute from the right. This should explain why the pieces and labels are flipped because both of those are on the grid. Feel free to assign this to yourself if you'd like to handle it. The problematic classes are .pgn-pfile-n in modules/ext.chessViewer.css

Hmm. does anyone know about the class pgn-pgn-display ? This sets a direction, but apparently it is never used in the source code of the player... Was it renamed perhaps at some point ?

Ah, another reason I didn't see this problem in the same way, was because I was using
https://he.wikipedia.beta.wmflabs.org/wiki/משתמש:קיפודנחש1/ChessBrowser_test_cases?uselang=en instead of
https://he.wikipedia.beta.wmflabs.org/wiki/משתמש:קיפודנחש1/ChessBrowser_test_cases?uselang=he

I forgot that flipping is based on interface language, not content language...

And what about the game details, the steps and the table ? what should their directionality be ?

Change 715576 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/ChessBrowser@master] Don't flip directionality of chessboards in RTL env.

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

I've also made some significant changes in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ChessBrowser/+/715603/
That still requires a bit more work, which I hope to do later this week.

Change 715576 merged by jenkins-bot:

[mediawiki/extensions/ChessBrowser@master] Don't flip directionality of chessboards in RTL env.

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

And what about the game details, the steps and the table ? what should their directionality be ?

Based on the Hebrew Wikipedia's implementation, I think the moves should be RTL in those locales. The game details are currently set up as a table, and since that's text it should probably be RTL though heWiki has the metadata in English it seems.

TheDJ claimed this task.
TheDJ moved this task from Needs triage to Completed on the ChessBrowser board.

Change 716046 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/ChessBrowser@master] Fix edge case of mixed rtl ltr rendering

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

Change 716046 merged by jenkins-bot:

[mediawiki/extensions/ChessBrowser@master] Fix edge case of mixed rtl ltr rendering

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

Based on the Hebrew Wikipedia's implementation, I think the moves should be RTL in those locales. The game details are currently set up as a table, and since that's text it should probably be RTL though he Wiki has the metadata in English it seems.

hmm. i was looking at it a bit more on that betalabs page.. And one problem i now see is with gxf4+ for instance. Because of the bidi algorithme, this now displays as +gxf4.. I can easily fix that by setting an ltr directionality on just the specific move strings... What do you think @Kipod ?