Page MenuHomePhabricator

Descriptions of Library partners appear with the user language direction
Open, Needs TriagePublic


My user language in the Library Card Platform is Hebrew. Most (or all) of the descriptions of partners are written in English. When I see them on the main page and on the partners list page, their descriptions appear with a right-to-left direction.

The direction of the element that contains the description must be set to the direction of the language in which they are written. Here are the options I can think of to fix this:

  1. If all of them are written in English, then it must be dir="ltr".
  2. If they can be written in different languages and the database has a property that specifies the language in which the description is written, then it should be set to the appropriate direction. So, for example, if we know that a description is written in English, Russian, or French, then it should be explicitly dir="ltr", and if we know that it's Arabic, Persian, or Hebrew, then it should be explicitly dir="rtl".
  3. If they can be written in different languages, but we cannot know in which one, then it's possible to do dir="auto". This will work if the first letter of the description is in the alphabet of that language, but it will fail if the first letter is in a different language. So, for example, if you have a description in Arabic for Noormags, but the first word of the description is "Noormags" in the Latin alphabet, the whole element will be set to ltr, which is not what is needed.

Solution 2 is ideal, but if it's too complicated to implement, solutions 1 or 3 are acceptable, too, and they are supposed to be very easy. It's also OK to do #3 now and #2 some time later.

Event Timeline

Restricted Application added subscribers: Huji, Aklapper. · View Herald Transcript

It's hard to tell without seeing what this looked like at the time the task was filed, but it looks to me like the english descriptions are LTR when other text is RTL, except that punctuation behaves strangely:

Screenshot 2024-05-28 at 09.56.54.png (1×2 px, 504 KB)

That said, partner descriptions which should be RTL aren't:

Screenshot 2024-05-28 at 09.58.21.png (1×2 px, 344 KB)