joplin icon indicating copy to clipboard operation
joplin copied to clipboard

support for RTL languages

Open majidasgari opened this issue 4 years ago • 41 comments

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.

  • Idea on forum: https://discourse.joplinapp.org/t/support-rtl-notes/4977/22?u=laurent
  • Related issue with some more ideas: https://github.com/laurent22/joplin/issues/2047

majidasgari avatar Oct 27 '20 22:10 majidasgari

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

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

but it is rather hard.

majidasgari avatar Oct 27 '20 22:10 majidasgari

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.

sabo3 avatar Nov 02 '20 10:11 sabo3

I think Joplin supports RTL currently but it can be facilitated by placing a button somewhere.

majidasgari avatar Dec 05 '20 20:12 majidasgari

https://github.com/laurent22/joplin/issues/3723 Any progress or plan to support ?

chromer030 avatar Jan 06 '21 19:01 chromer030

@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 ?

chromer030 avatar Jan 14 '21 16:01 chromer030

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.

laurent22 avatar Jan 14 '21 17:01 laurent22

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

chromer030 avatar Jan 14 '21 17:01 chromer030

@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!

ma-sadeghi avatar Jan 14 '21 17:01 ma-sadeghi

Is someone working on this ? Or is it already fixed ? I'm Arabic and I'd be able to give it a go and test myself easily.

Ahmad45123 avatar Mar 21 '21 18:03 Ahmad45123

Is someone working on this ? Or is it already fixed ?

No and no

roman-r-m avatar Mar 21 '21 20:03 roman-r-m

image So I've added RTL support for the actual text editors (markdown and tinymce). There's also another places that could use the same fix like where I have a rex box but I'm not so sure about it.

The UI itself is not RTL so why make all text in the UI go RTL, like for instance that title bar would look really off if it was to the right beside the time. The only way it'd look nice would be if all the info buttons and date/time also swap.

As much as I'd like full RTL support, It's not a simple thing and I don't think it's something that Joplin wants right now ? IDK.

Let me know what you guys think!

Ahmad45123 avatar Mar 23 '21 21:03 Ahmad45123

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

laurent22 avatar Apr 30 '21 15:04 laurent22

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

mikwee avatar Jul 09 '21 10:07 mikwee

Is there any update on this issue?

3droj7 avatar Jul 20 '21 14:07 3droj7

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

mikwee avatar Jul 23 '21 19:07 mikwee

+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

mbnoimi avatar Oct 13 '22 16:10 mbnoimi

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 !

chromer030 avatar Oct 13 '22 17:10 chromer030

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 avatar Oct 13 '22 17:10 mikwee

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...

mikwee avatar Oct 13 '22 17:10 mikwee

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.

mbnoimi avatar Oct 13 '22 18:10 mbnoimi

https://github.com/microsoft/vscode/issues/11770

chromer030 avatar Oct 16 '22 10:10 chromer030

see this fix https://github.com/laurent22/joplin/issues/6177#issuecomment-1546739810 I use it and It's OK.

mojienjoyment avatar May 13 '23 20:05 mojienjoyment

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.

rio-codes avatar May 25 '23 07:05 rio-codes

for reference and sake of tests, you may use:

text

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

incorrect view

image

correct view

image

2i3r avatar Aug 04 '23 10:08 2i3r

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

mohammadZahedian avatar Sep 02 '23 10:09 mohammadZahedian

https://github.com/laurent22/joplin/issues/6177#issuecomment-1741767309 if anyone interested i made a simple solution here using css for rendering

Guyc1800 avatar Sep 30 '23 16:09 Guyc1800

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

mbnoimi avatar Sep 30 '23 16:09 mbnoimi

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

Guyc1800 avatar Sep 30 '23 18:09 Guyc1800

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

Guyc1800 avatar Sep 30 '23 18:09 Guyc1800

: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 avatar Sep 30 '23 18:09 mbnoimi