Page MenuHomePhabricator

Don't flip fractions in RTL or opt for optional translation from "/" to "out of"
Open, In Progress, LowPublic

Description

On the view function page ("Details" tab) we display a table for listing implementations and/or test. If the number of implementations/tests is higher than 5, we paginate the table. To navigate the pagination users can do that either via a next/previous button, or with a page control.

CleanShot 2023-07-25 at 11.39.09@2x.png (932×2 px, 140 KB)

On RTL locales we flip the layout, but we should not flip the fraction direction (if we consider that to be a fraction), since

In-line fractions are written with the numerator and denominator on the left and right of the fraction slash respectively, e.g. ٢/٧ 2/7. Source.

CleanShot 2023-07-25 at 11.40.14@2x.png (912×2 px, 119 KB)

If we don't consider that to be a fraction what we could do is to add an optional translation for RTL languages that instead of displaying in RTL 2 **/** 1 it displays 2 **out of **1.

Event Timeline

AAlhazwani-WMF renamed this task from Don't flip fractions in RTL to Don't flip fractions in RTL or opt for optional translation from "/" to "out of".Jul 25 2023, 4:06 PM
AAlhazwani-WMF updated the task description. (Show Details)
Jdforrester-WMF subscribed.

Engineering note: This 'should' be as simple as either a hard-coded dir="ltr" on ext-wikilambda-pagination__page-selector__main or a @noflip annotation in the CSS for css-janus, but I've not dug in.

Change #1014502 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] Pagination component: Don't flip the fraction in RTL environments

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

Jdforrester-WMF changed the task status from Open to In Progress.Mar 26 2024, 1:15 PM
Jdforrester-WMF claimed this task.
Jdforrester-WMF moved this task from Backlog to In Progress on the Abstract Wikipedia team board.

If we don't consider that to be a fraction what we could do is to add an optional translation for RTL languages that instead of displaying in RTL

These aren't fractions. A message that says "out of $1" is probably a better solution. And it will be clearer in all languages, not only the RTL ones.

If we don't consider that to be a fraction what we could do is to add an optional translation for RTL languages that instead of displaying in RTL

These aren't fractions. A message that says "out of $1" is probably a better solution. And it will be clearer in all languages, not only the RTL ones.

makes sense. we might be able to also address this once we can use the codex table component, which comes with a built-in footer T303320: Table: Add Table component to Codex

image.png (786×1 px, 120 KB)

Follow-up: I've tried this on the page https://www.wikifunctions.org/wiki/Z13087?uselang=he , and I actually don't think that it's much of an RTL problem to begin with. The current display works well enough in Hebrew. Perhaps you can ask for more opinions from people who use wikis in Arabic, Persian, Punjabi (pnb), etc., but I don't think their opinion will be very different (but I might also be wrong).

I still think that changing it from "/" to words is better for all languages, and not just for RTL, but it's not a very high priority issue.

I think I do see another issue here: the digits are not localized. For example, they should probably appear in Eastern Arabic numerals when you view the page in Persian: https://www.wikifunctions.org/wiki/Z13087?uselang=fa . But that's a general i18n issue and not an RTL issue, and someone who uses Persian wikis should verify that it's actually a problem. If it is, it should be reported as a separate task.