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

Request for Comment: Text Direction (LTR/RTL) Handling for Page Content #4867

Open
ssddanbrown opened this issue Feb 25, 2024 · 0 comments
Open

Comments

@ssddanbrown
Copy link
Member

ssddanbrown commented Feb 25, 2024

Current Handling

Within the page editor we set a text direction based upon the user's language preference.
If it's a RTL language, we'll load the editor as RTL, with added text direction controls. Otherwise it's shown as LTR.

When viewing page content, we set the direction to auto, meaning the browser will auto infer the content direction based upon the it's written in. From testing experience, this often means direction is inferred from the page name/title.

Current Problems

The difference in edit/display can cause differences in presentation between the editor and page view.
A RTL language editor can save their page, and see content flip if that content is written in English. I believe the reverse would be true too.

I don't think we should try to use auto in the editors, since the content will be changing and provide an unstable/uncontrolled experience.

Proposed Solution

  • Store the text direction against the page entry (much like we do for the editor type now).
    • Defaults to the page creator's language text direction.
  • Use the stored page text direction for display, regardless of viewer user language.
  • Use the stored page text direction for editing, regardless of editor user language.
  • Provide control to change this page text direction.

Questionables

  • Where do we expose the added text-direction control?
  • Should the markdown editor be flipped? Currently the layout is flipped in RTL but the code editor remains LTR.

Input Welcomed

I'd really like some feedback on this, especially as someone not well-versed in RTL languages myself, only familiar with them via supporting them in BookStack. Below are some specific areas I'd like feedback on:

  • Does the proposed solution seem sensible?
  • Are there additional considerations/issues that are not covered by this solution?
  • Could the solution introduce new issues?
  • Response to questionables above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant