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

support for RTL languages #3991

Open
majidasgari opened this issue Oct 27, 2020 · 38 comments · Fixed by #4822
Open

support for RTL languages #3991

majidasgari opened this issue Oct 27, 2020 · 38 comments · Fixed by #4822
Labels
desktop All desktop platforms enhancement Feature requests and code enhancements high High priority issues

Comments

@majidasgari
Copy link

majidasgari commented Oct 27, 2020

Have you plan to support RTL languages, Joplin supprts Farsi as its interface language, but when we type in persian in the text editor, all texts are viewed in left to right mode.

@majidasgari
Copy link
Author

we can show any rtl text in the current version using div tags

<div dir="rtl">
یک متن فارسی یا عربی.
<div>

but it is rather hard.

@sabo3
Copy link

sabo3 commented Nov 2, 2020

In addition to the above, I would like to report that when using Joplin on android with Arabic locale, the app layout is messed up. The side menu looks disoriented as shown in the attached photo.

@stale stale bot added the stale An issue that hasn't been active for a while... label Dec 3, 2020
@majidasgari

This comment has been minimized.

@stale stale bot removed the stale An issue that hasn't been active for a while... label Dec 5, 2020
@chromer030

This comment has been minimized.

@chromer030
Copy link

@laurent22
SImpleNote has nearly perfect support for RTLs , tested Hebrew , Persian , Arabic.
Its weird why Joplin as the best open-source Note taking platform hasn't yet integrated RTLs support ?

@laurent22 laurent22 added backlog We'll get to it... eventually... enhancement Feature requests and code enhancements labels Jan 14, 2021
@laurent22
Copy link
Owner

Let's keep this bug open to track this issue, and I've also added a few links from past discussion in the top post.

What's not working by the way? It would be good if someone could confirm what works or not on the following elements.

  • Desktop: Markdown editor
  • Desktop: Markdown viewer
  • Desktop: Rich Text
  • Mobile: Text editor
  • Mobile: Text viewer

Also please provide some example Arabic text: the actual text (that can be copied and pasted, not a screenshot), and how it's supposed to look (a screenshot), because I don't know Arabic language so I don't know when it's displayed RTL or LTR.

@chromer030
Copy link

chromer030 commented Jan 14, 2021

Hi @laurent22 , Thank you for your attention on this issue , you will really save the RTL users from this annoying bug.

Desktop : Markdown editor and Marktop viewer :

In Desktop client , on markdown editor and viewer , we can write in RTL languages and languages are supported but layout is not respected and it's remain on LTR :

Hebrew :
1
Arabic :
2
Persian :
3

Desktop: Rich Text :

Layout is not respected :
4

Mobile : Text Editor :

Layout and RTL is OK.

Screenshot_20210114-210347

Mobile : Text Viewer :

RTL languages are supported but layout is not respected :

Screenshot_20210114-210402

Correct layout of RTL :

Screenshot_2021-01-14_21-19-23

As you see in screenshot , RTL should start from right to left and this is true form.

Some example texts in Arabic , Hebrew and Persian :

Arabic :

بعد أن تلقى الملايين حول العالم اللقاحات المختلفة لفيروس كورونا المستجد، برزت أسئلة عديدة، أبرزها ما مدى إمكانية نقل الفيروس من الشخص الذي تلقى اللقاح إلى الأصحاء؟ وهل اللقاحات المطروحة حالياً فعّالة ضد السلالات المتحورة من فيروس كوفيد-۱۹؟

Hebrew :

"אני שומע כל הזמן שיח על תעדוף, אלה רוצים ואלה רוצים. אבל יש ועדת תעדוף, הם אלו שקובעים ואנחנו הולכים אחרי מה שהם אומרים לנו", אמר אדלשטיין, "במקום להמשיך בדיון הזה, שווה לחשוב מה יקרה אם האסיר יחלה ונצטרך לזבזב עליו צוות רפואי ומכשירי אקמו. מה שוועדת התעדוף החליטה זה מה שאנחנו עושים. אני לא בודק אם נותנים את החיסון לאסיר או לסוהר".

Persian :

نسخه پایه پرچمدار امسال سامسونگ گلکسی اس ۲۱ نام داشته و باید آن ارزان‌قیمت‌ترین و در عین حال ساده‌ترین نوع گوشی گلکسی اس ۲۱ عرضه شده در بازار بدانیم. نسخه دوم گلکسی اس ۲۱ پلاس است که ظاهراً تنها در ابعاد نمایشگر و کلی دستگاه با نسخه پایه متفاوت است ولی برخی تغییرات مانند جنس بدنه را نیز در ردیف تفاوت‌های دو دستگاه جای دهیم.

Test Devices :

Desktop : Joplin 1.6.7 appimage on Arch Linux , Kernel 5.10.7.
Mobile : Joplin 1.6.6 on Android 7.1.2 arm64

@ma-sadeghi
Copy link

ma-sadeghi commented Jan 14, 2021

@laurent22 @chromer030

I found a workaround to fix Desktop rendering of RTL notes: I simply added:

#rendered-md p {
    unicode-bidi: plaintext;
}

to userstyle.css. The beauty of it is that it also works fine with mixed RTL-LTR notes. Here's how it looks like:

image

The first line is pure Farsi, the second line is mixed Farsi-English, and the third line is pure English, which they all render properly.

There's still one issue that makes it a bit inconvenient working with the editor. If you look at the second line (mixed Farsi-English) in the editor (not the rendered markdown), it doesn't look right.

Similar issue for the first line in the editor: look at the placement of the "dot", which should be at the end of the sentence (like it is in the rendered markdown)

Edit: Here's a mixed Farsi-English note for reference:
متن فارسی به همراه کلمه English در میان

which is btw not rendered properly on GitHub!

@laurent22 laurent22 added desktop All desktop platforms high High priority issues and removed backlog We'll get to it... eventually... labels Jan 14, 2021
@Ahmad45123

This comment has been minimized.

@roman-r-m

This comment has been minimized.

@Ahmad45123

This comment has been minimized.

@laurent22
Copy link
Owner

Note: It's now done for Markdown editor and Preview

Repository owner deleted a comment from ma-sadeghi Apr 30, 2021
Repository owner deleted a comment from stale bot Apr 30, 2021
@mikwee
Copy link

mikwee commented Jul 9, 2021

RTL support is still a problem, as someone who has to write in Hebrew.
Joplin_wUoxmdBWDH

@3droj7
Copy link

3droj7 commented Jul 20, 2021

Is there any update on this issue?

@mikwee
Copy link

mikwee commented Jul 23, 2021

Using the iOS app rn, and it properly renders Hebrew text in the preview, but not in editing mode. Still have yet to see if it works like this on Android and Desktop.
180D6639-1344-4EB7-B040-DF9031A6F35B
4FB2506C-0F7D-4AED-A70C-7F96635D2F46

@mbnoimi
Copy link

mbnoimi commented Oct 13, 2022

+1
RTL implementation still unpractical. I'm unable to use Joplin at all in Arabic

image

Although the text editor has many issues but it can render the text most of the cases in the right layout while the viewer doesn't at all. The viewer always render the text in LTR

  • Joplin 2.8.8 (flatpak package)
  • Linux Mint 21

@chromer030
Copy link

No RTL in vscode , no RTL in joplin , no RTL in many others , why apps like this with many users have issue with RTL ? , RTL is cursed !

@mikwee
Copy link

mikwee commented Oct 13, 2022

It's because, like most things, web dev tools are created with LTR languages in mind, since those have the most speakers. Then again, there are 365 million native speakers of Hebrew and Arabic alone, so I do think RTL support should be a major concern for software devs.

@mikwee
Copy link

mikwee commented Oct 13, 2022

In addition to the above, I would like to report that when using Joplin on android with Arabic locale, the app layout is messed up. The side menu looks disoriented as shown in the attached photo.

So this is because of RTL? I was wondering why this was happening...

@mbnoimi
Copy link

mbnoimi commented Oct 13, 2022

No RTL in vscode , no RTL in joplin , no RTL in many others , why apps like this with many users have issue with RTL ? , RTL is cursed !

Most editors support RTL. RTL is not needed in VSCode because most programming languages based on languages grammar in LTR.
For example Flutter supports RTL by default, Qt, GTK... etc. Even Github supports it too.

@chromer030
Copy link

microsoft/vscode#11770

@mojienjoyment
Copy link

mojienjoyment commented May 13, 2023

see this fix #6177 (comment)
I use it and It's OK.

@rio-codes
Copy link
Contributor

I did a little testing on this with Hebrew, some Markdown features work and some do not. I used the lyrics to a song in both English and Hebrew to demonstrate:
2023-05-25-000142_1552x953_scrot

The checkboxes are totally broken, nested bullet lists do not work, and deleting characters at the beginning or end of a line is extremely frustrating, in both keyboard layouts. It seems to always want to delete as if the language was LTR.

Apparently Showdown is able to display and edit RTL properly, I'm not sure if this can be implemented but I am willing to give it a shot.

@2i3r
Copy link

2i3r commented Aug 4, 2023

for reference and sake of tests, you may use:

text

این یک متن فارسی حاوی کلمات Complex English است.
هذا نص عربي يحتوي على كلمات Complex English .

incorrect view

image

correct view

image

@mohammadZahedian
Copy link

i have problem with search in Persian language
1- you should write all letter of words or sentence to find it
now i use '*' after part of word to find it faster
but still if your note was misspell when you wrote it, you will never find it again

@Guyc1800
Copy link

#6177 (comment)
if anyone interested i made a simple solution here using css for rendering

@mbnoimi
Copy link

mbnoimi commented Sep 30, 2023

if anyone interested i made a simple solution here using css for rendering

Thanks for the suggestion but it doesn't fix it correctly!!!

Your suggestion:

ul:not(ul.jop-noMdConv) {
  direction: rtl;
  & li.md-checkbox.joplin-checkbox.maps-to-line {
    position: relative;
    left: 3em;
    & input[type="checkbox"] {
      margin-left: 0.7em;
      margin-right: 1.71em;
    }
  }
}
p.maps-to-line:has(> en, ltr) + * {
  direction: ltr;
  & li.md-checkbox.joplin-checkbox.maps-to-line {
    position: relative;
    left: -3em;
    & input[type="checkbox"] {
      margin-left: 1.71em;
      margin-right: 0.7em;
    }
  }
}

image
image

@Guyc1800
Copy link

It might uses different selector for numbered lists let me fix that real quick

@Guyc1800
Copy link

if anyone interested i made a simple solution here using css for rendering

Thanks for the suggestion but it doesn't fix it correctly!!!

Your suggestion:

ul:not(ul.jop-noMdConv) {
  direction: rtl;
  & li.md-checkbox.joplin-checkbox.maps-to-line {
    position: relative;
    left: 3em;
    & input[type="checkbox"] {
      margin-left: 0.7em;
      margin-right: 1.71em;
    }
  }
}
p.maps-to-line:has(> en, ltr) + * {
  direction: ltr;
  & li.md-checkbox.joplin-checkbox.maps-to-line {
    position: relative;
    left: -3em;
    & input[type="checkbox"] {
      margin-left: 1.71em;
      margin-right: 0.7em;
    }
  }
}

image
image

:is(ul,ol,dl):not(.jop-noMdConv){
direction:rtl;
& li.md-checkbox.joplin-checkbox.maps-to-line{
position:relative;
left:3em;
& input[type=checkbox]{
margin-left:0.7em;
margin-right:1.71em;
}
}
}
p.maps-to-line:has(>en,ltr)+*{
direction:ltr;
& li.md-checkbox.joplin-checkbox.maps-to-line{
position:relative;
left:-3em;
& input[type=checkbox]{
margin-left:1.71em;
margin-right:0.7em;
}
}

}

Here is the fix. It still isn't perfect since when in full edit view the checkboxs override the text but it's better then nothing I guess

@mbnoimi
Copy link

mbnoimi commented Sep 30, 2023

:is(ul, ol, dl):not(.jop-noMdConv) {
  direction: rtl;
  & li.md-checkbox.joplin-checkbox.maps-to-line {
    position: relative;
    left: 3em;
    & input[type="checkbox"] {
      margin-left: 0.7em;
      margin-right: 1.71em;
    }
  }
}
p.maps-to-line:has(> en, ltr) + * {
  direction: ltr;
  & li.md-checkbox.joplin-checkbox.maps-to-line {
    position: relative;
    left: -3em;
    & input[type="checkbox"] {
      margin-left: 1.71em;
      margin-right: 0.7em;
    }
  }
}

For me it's perfect. Thank you @Guyc1800

@mbnoimi
Copy link

mbnoimi commented Oct 3, 2023

Oops I discovered it doesn't work fine!
@Guyc1800

The above snippet force all the lists into RTL!
image

@Guyc1800
Copy link

Guyc1800 commented Oct 3, 2023

Oops I discovered it doesn't work fine!
@Guyc1800

The above snippet force all the lists into RTL!
image

Yeah this is the idea and if you want the next line or list to be ltr add this
<en></en>
Before just like in the screen shot I sent

@mbnoimi
Copy link

mbnoimi commented Oct 3, 2023

Yeah this is the idea and if you want the next line or list to be ltr add this

Add what?!

@Guyc1800
Copy link

Guyc1800 commented Oct 4, 2023

Yeah this is the idea and if you want the next line or list to be ltr add this

Add what?!

My bad . Github didn't show this because i didn't put it inside of code block
Anyway you need to add a line before
<en></en> or <ltr></ltr>

@Mehrdad-Farshi
Copy link

I did a little testing on this with Hebrew, some Markdown features work and some do not. I used the lyrics to a song in both English and Hebrew to demonstrate: 2023-05-25-000142_1552x953_scrot

The checkboxes are totally broken, nested bullet lists do not work, and deleting characters at the beginning or end of a line is extremely frustrating, in both keyboard layouts. It seems to always want to delete as if the language was LTR.

Apparently Showdown is able to display and edit RTL properly, I'm not sure if this can be implemented but I am willing to give it a shot.

as @rio-codes tested bullet points with Hebrew I've found the same issue with tables and quotes in the Linux desktop app

image

@yuvgin
Copy link

yuvgin commented Mar 18, 2024

Any updates on this issue? Is anyone actively working on this?

@Yolakalemowa
Copy link

Yolakalemowa commented Apr 20, 2024

Any updates on this issue? Is anyone actively working on this?

wondering the same :'(

Joplin, Standard Notes, Notesnook... how come NON of them properly support RTL?

edit: SN does seem to support RTL now... nice @mojienjoyment

@mojienjoyment
Copy link

mojienjoyment commented Apr 20, 2024

Ruslin-android, a note app for android can show rtl and ltr languages correctly. Devs can get idea from it on 1,2,3,4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop All desktop platforms enhancement Feature requests and code enhancements high High priority issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.