Fix mixed text direction
Thread poster: Hassan Achahbar
Hassan Achahbar
Hassan Achahbar  Identity Verified
Morocco
Local time: 17:08
English to Arabic
+ ...
Nov 21, 2020

Proz is probably old enough to have a driver's license in any country but its support for right-to-left languages is a mess. Whenever a paragraph starts with LTR and includes RTL content the result is an incorrect order of segments making the paragraph impossible to read. A single Latin character will confuse an Arabic paragraph beyond readability. Paragraphs containing LTR only content are incorrectly aligned too, but this issue is of lesser importance since readability is not affected.

2020-11-21_160143

The text above is unreadable, and it gets worse when you throw in more Latin characters. To get around this issue I jump to a new line every time I want to include Latin words/characters. I noticed many translators do this too.

The attribute dir="auto" is an HTML5 attribute that fixes mixed user content formatting. It's an HTML attribute, CSS "direction" property only recognizes rtl and ltr, "auto" value is invalid, at least for now.

This is how W3 describes the attribute:
https://www.w3.org/International/articles/inline-bidi-markup/

HTML5 addresses another need: text dropped into a page, say from a database, when you don't know its base direction. Before HTML5, you could only set the dir attribute to ltr or rtl, and had to somehow determine yourself which of them was appropriate.

HTML5 provides a new value for the dir attribute: auto. The auto value tells the browser to look at the first strongly typed character in the element. If it's a right-to-left typed character such as a Hebrew or Arabic letter, the element will get a direction of rtl. If it's, say, a Latin character, the direction will be ltr.

There are corner cases where this may not give the desired outcome, but it should usually produce the desired result.

Note that the browser ignores any neutral or weak characters at the beginning of the text when looking for the first strong character. It also ignores anything inside a bdi element or an element with a dir tag of its own, including auto.

Like any other use of the dir attribute in HTML5, dir="auto" also directionally isolates its content from its surroundings.


This attribute should be applied only to the text's immediate container in the view template so as not to interfere with the site's global layout, and to both the old table-based and the new div-based layouts. Since the attribute only affects how text is displayed it will fix the presentation of all previous mixed direction entries over the 20 years or so of Proz existence. The place where I want to see this issue fixed as soon as possible is the KudoZ section, specifically the term and explanation entries. But the fix should be applied to all user content templates. I had made a similar suggestion 6 years ago when I found out the contest entries are badly formatted, but my suggestion was only applied to contest entries.

2020-11-21_174450

As you can see in the screenshot above, after adding this tag, the paragraph is correctly formatted and is aligned to the right. But text direction is separate from text alignment. You can have an Arabic text correctly formatted with dir="auto" and still be able to align the text any way with CSS property text-align.

If you need any help fixing this issue I'll be glad to assist.

[Edited at 2020-11-21 16:46 GMT]


Arabic & More
 
Hassan Achahbar
Hassan Achahbar  Identity Verified
Morocco
Local time: 17:08
English to Arabic
+ ...
TOPIC STARTER
Three weeks later... Dec 13, 2020

Has anyone from the staff seen this post?
This issue affects all RTL languages which include Arabic, Hebrew, Pashto, Persian, Urdu and other languages.

[Edited at 2020-12-13 13:31 GMT]


 
Andrea Capuselli
Andrea Capuselli
Local time: 14:08
SITE STAFF
SITE LOCALIZER
Thank you for this suggestion, it will be tested in the near future Dec 14, 2020

Dear Hassan,

Thank you for your suggestion, and for your patience.

A developer from the team has reviewed it, and agreed this should be applicable. It will be tested and, if everything works as expected, released in the near future.

Thank you again for taking the time to propose a solution, and for your support of the site.


 
Hassan Achahbar
Hassan Achahbar  Identity Verified
Morocco
Local time: 17:08
English to Arabic
+ ...
TOPIC STARTER
Great! Dec 17, 2020

That is really good news, thank you!

 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Fix mixed text direction






Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »
Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

Buy now! »