-
-
Notifications
You must be signed in to change notification settings - Fork 62.1k
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
Solve some problems with RTL Languages #6714
Comments
if we set a section talking about this solution in Guidelines in CONTRIBUTING (after we finish discussing it here of course) Other contributors can do the same with their own RTL languages |
Thanks for adding this. We can leave it open for a while. |
As commented in #6715 if this marks, HTML entity or unicode raw character breaks alphabetize plugin, even worst when are placed at the begining of sentence (the reason: see Moreover, non printable version should be used instead of HTML entity. Remember that Markdown markup should be HTML agnostic |
To support bidirectional text alphabetization (https://en.wikipedia.org/wiki/Bidirectional_text) Via EbookFoundation/free-programming-books#6714
@davorpa i can make regex patterns for all these cases |
Go ahead 😉. It can be helpful to any maintainer ❤️ |
@AhmedElTabarani Hello sir, can I work on this? |
About regex putterns ? Ok no problems at all I was working on it but i was very busy this weeks. I was decided to make a JavaScript script to detect all of these and some unit tests to make everything organized This is last thing I ended up with, maybe it will help you.
|
The main RTL languages are Arabic, Persian and Hebrew... which are only 3 out of all the languages translated on this repo... might be better to have a special section for these languages... as it is not relevant for all the LTR ones. |
Have you tried the following?
|
some good ideas in this issue. Would welcome a PR. |
does this issue still needs to be fixed |
Can i work on this issue. |
Here I will talk about some problems with RTL Languages and their solutions.
I will explain all the points here, and we can have a discussion about it.
And maybe add a section that talking about these problems & solution in Guidelines in CONTRIBUTING
The base discussion on this issue starts on this PR #6706 and #6715
What is the issue ?
If we have an RTL text here
Note :
تعلم البرمجة
means thatLearn Programming
It will appear on the website like this:
In this case, we can just
dir="rtl"
Result:
Is that it ?, No! The monster will show up below 😢
Mixing RTL with LRT languages issue !
The real problem is that when mixing RTL with LRT languages
Case 1
Note :
تعلم
means thatLearn
.Result:
Look, he put words in the mixer!
Case 2
If we need to make LTR to go right (both author name and title are LTR)
Result:
Both words have been swapped!!
Solution ?
We can solve these two problems with Unicode mark called RLM:
https://en.wikipedia.org/wiki/Right-to-left_mark
By adding
‏
after the LRT word that we need to mark it as RTL (it will pretend as RTL word)Solve case 1
Result:
We added
‏
afterHTML
Solve case 2
Result:
You get the point!
Extra Cases!
Case 1
Try to make
C#
go to right!Note:
* [تعلم لغة C# الرائعة](URL) - إسم المؤلف
means* [Learn the Cool C# Language] (URL) - Author Name
Result:
The Symbols have the same problem when we try to RTL it
And it has the same solution 😉, by LRM Unicode mark:
https://en.wikipedia.org/wiki/Left-to-right_mark
We use
&lrm
not&rlm
, why?The issue with the symbol is that when we try to add a RTL attribute to
C#
to make it get to rightIt will render as a RTL word, so the symbol will reorder to the other side.
By adding
‎
after theC#
we mark it as LTR word, so it will render as LTR wordCase 1.1
Both
Author Name
andTitle
are LTR and end with a symbol asC#
Result:
The first here will be simple, just put
‏
at the end of the titleResult:
But note that the symbol
#
renders as a RTL word, so it will reorder to the other side.so we must use
‎
after this symbol.Result:
Case 2
If the
Title
in English and theAuthor Name
in ArabicResult:
It is enough to make the direction be RTL only without putting any Unicode mark
Result:
Case 3
Sometimes we add some information like
(:construction: *in process*)
after the author nameResult:
It seems like it is correct, but we read from right to left, so it would be nice if this information was in left to read the author name first then the information
So to solve this, we just put
‏
after the nameResult:
The text was updated successfully, but these errors were encountered: