Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Right-to-Left (RTL) support #3279

Open
PandaBrrr opened this issue Dec 26, 2023 · 11 comments
Open

Feature request: Right-to-Left (RTL) support #3279

PandaBrrr opened this issue Dec 26, 2023 · 11 comments
Assignees

Comments

@PandaBrrr
Copy link

Texts in languages that are written right-to-left (Hebrew, Arabic, Persian, etc.) are currently displayed incorrectly. With close to a billion of speakers worldwide, this issue likely affects tens of millions of potential users.

There are two main issues that make reading RTL languages in LTR configuration difficult:

  1. All text is aligned left when it should be aligned right (minor)
  2. The order of words and sentences with LTR (e.g., English) words gets messed up (major)

Example

  1. Original article:
    image

  2. Article in Omnivore
    image

As you can see, the red line representing the first part of the sentence, gets broken in two in Omnivore, with the first half appearing before blue and green, and the second half after. It should be displayed unbroken before the two other parts of the sentence.

A solution to this issue would be greatly appreciated.

@jacksonh
Copy link
Contributor

jacksonh commented Jan 2, 2024

We've looked at this one a couple times and its a bit more work than initially expected. But going to try and get it out of the way now. I see a few distinct pieces we need to do:

  • add a direction property to library_item
  • in puppeteer-parse, the browser extension, and iOS try to detect direction. The reason it needs to be done here is we often don't save the <body tag with items
  • Update reader to fetch and set this property
  • Update the updatePage API to allow setting this property

@PandaBrrr
Copy link
Author

This would be the best gift for 2024 for many users like myself! Fingers crossed.

@PandaBrrr
Copy link
Author

@jacksonh
I just thought of a temporary quick workaround.
Would it be possible to add an RTL display option per article? Similar to justify text or changing the color of the display.

@jacksonh
Copy link
Contributor

jacksonh commented Mar 4, 2024

@PandaBrrr sorry i missed your comment before. That's exactly what I am starting to do here: #3619

Basically our next steps are:

  • Allow user to switch to RTL mode (its actually set as a cookie value, so it will always be the last set value)
  • Roll out a change to start detecting the page's RTL value when parsing (sadly this requires extension and iOS updates also)
  • Start setting the value based on the parsed page value.

I am also wondering about changes to the library view, it might be tricky to mix RTL and LTR titles in the library, along with summaries.

@PandaBrrr
Copy link
Author

@jacksonh
That's brilliant, thank you! Even having just the switch would be a huge QoL improvement, but automatic detection would be sweet af.

I dug up my old Pocket account to see how they do it:

image

  1. Title
  2. Source
  3. Reading time
  4. Picture (duh)
  5. Tags

I don't see any summary in the mobile app, but I can check how it works in the web viewer when I'm back home.

@jacksonh
Copy link
Contributor

jacksonh commented Mar 4, 2024

oh funny, so they do RTL the title but left everything else LTR?

@PandaBrrr
Copy link
Author

@jacksonh
Yup. It works well on a small-ish mobile screen. IIRC, they do it similarly in the web client.

@jacksonh
Copy link
Contributor

jacksonh commented Mar 5, 2024

@PandaBrrr the code to detect RTL isn't live yet but you can manually enable it now on web by going into the reader settings (the thing where you set the font), going to advanced, and enabling right to left text. Unfortunately this will set it for all articles at the moment. You'll also have to do a refresh of your browser after enabling it.

@PandaBrrr
Copy link
Author

@jacksonh That's brilliant, thank you!

I'm testing it now.

@jacksonh
Copy link
Contributor

jacksonh commented Mar 7, 2024

Thanks, i did some testing for library changes to support too. The detection changes might take a bit more as it requires extension updates and mobile app updates.

@kbdragon
Copy link

kbdragon commented Jun 8, 2024

@jacksonh
Hi Jackson, is there any update on implementing the automatic encoding detection? It sometimes works when I use the extension on android, but doesn't work on the web.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants