Skip to content

RTL languages should have LTR notebooks by default #5921

@Gilthans

Description

@Gilthans

Describe the bug
When the default language is set to an RTL (right-to-left) language (such as hebrew or arabic), the notebook UI is unusable.
Since translation is only partial, english text becomes garbled, and elements that should always be LTR (such as code blocks) are reversed, while others that maybe should be RTL (such as output blocks) are not.

To Reproduce

  1. Go to Chrome's settings.
  2. Go to "Languages".
  3. Set "Hebrew" as the top priority.
  4. Open a new jupyter notebook.

Expected behavior
Either properly support RTL language (a lot of work), or use LTR.

Screenshots
(Taken from this very old ipython issue)
Here's a screenshot - there's nothing useful in Hebrew here, but you get the period on the wrong end of the sentence, and the path is reversed.
image

Again, no useful information in Hebrew, the In [ ] bullets are on the wrong side, and you get RTL only when it's not helpful. If anything, I'd want the word שלום to be right-aligned, but nothing else.
image

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Version: 87

Additional context
There's a long standing ipython issue about this, ever since this was implemented. Most developers I know ran into this, found that issue, and used one of the workaround. This has always been a terrible default.

Note that the RTL layout is never correct. No user would use it intentionally because it solves no problems and creates several.

The solution is simple:
In notebook/static/bidi/bidi.js, the conditional setting of document.body.dir should be removed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions