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 #3983

Closed
avidseeker opened this issue Jul 21, 2024 · 2 comments
Closed

Bidirectional text support #3983

avidseeker opened this issue Jul 21, 2024 · 2 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:

@patrickhlauke
Copy link
Member

I'd suggest taking this to https://github.com/w3c/wcag3 rather than here, as there won't be any new requirements added to 2.x. I can see how this conceptually is similar to the requirement for programmatically determined language of documents, though it would be good to demonstrate first how this is something that affects people with disabilities specifically (and isn't just a general code quality issue not specific to accessibility requirements)

@avidseeker
Copy link
Author

Moving to w3c/wcag3#105, then.

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

2 participants