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

Bidirectional text support #105

Open
avidseeker opened this issue Jul 22, 2024 · 0 comments
Open

Bidirectional text support #105

avidseeker opened this issue Jul 22, 2024 · 0 comments

Comments

@avidseeker
Copy link

Proper bidirectional text navigation, editing, and typing is essential for speakers of Right-to-left languages.

Unicode specifies Unicode Bidirectional Algorithm (UBA) for programs to automatically detect the directionality of each paragraph. Although it is properly implemented in GUI toolkits such as GTK and QT, unfortunately, this algorithm is still not implemented in many major browsers.

All of the previously listed issues are related to text fields and the alignment of text within them. However, this should also apply to HTML rendering, meaning that if two paragraphs in HTML source are:

<p>
	Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
</p>
<p>
	قِفَا نَبْكِ مِنْ ذِكْرَى حَبِيبٍ ومَنْزِلِ، بِسِقْطِ اللِّوَى بَيْنَ الدَّخُول فَحَوْمَلِ. فَتُوْضِحَ فَالمِقْراةِ لمْ يَعْفُ
</p>

Then the browser would apply UBA on the second paragraph so that it renders it the same as it renders:

<p>
	Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
</p>
<p dir="rtl">
	قِفَا نَبْكِ مِنْ ذِكْرَى حَبِيبٍ ومَنْزِلِ، بِسِقْطِ اللِّوَى بَيْنَ الدَّخُول فَحَوْمَلِ. فَتُوْضِحَ فَالمِقْراةِ لمْ يَعْفُ
</p>

Here is for example how it is rendered in UBA-supported text editor (GTK):

image

Of course, the dir HTML attribute would still stay as a way to force text direction, but by default, applying UBA would be more close to what the end-user would expect.

I hope that by adding Bidirectional Text Support as a WCAG standard, that'll push browsers to implement it.

Resources and readings:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant