WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Best practice for language markup


From: jp Jamous
Date: Jul 26, 2022 5:45AM

Another thing to consider when using Eastern languages is the dir attribute. I have witnessed many language of parts that use lang=”ar”, which means Arabic. What ends up happening is that the text is flushed left when Arabic is a right to left language.

I thought it was just visual in the past. However, I was able to confirm with a buddy of mine that it caused problems bisually and with screen readers as they tried to pronounce the words.

It depends on how the text is being implemented as well. For example, if you have something like this:
Name: JP Jamous
Yet, it is written in Arabic, Name would have to be flushed right, JP would be in the middle and Jamous would be to the left of JP. Without the dir=”rtl” there is a possibility that some screen readers reads the Arabic version from left to right. For example.
Jamous JP :Name
Now, that will sound quite weird when being spoken with a screen reader. It is less of a problem visually, but it remains an issue. The sighted person would have to read left to right but flip the text right to left when processing it cognitively. It can be a cognitive overload after a while.

From: WebAIM-Forum < <EMAIL REMOVED> > On Behalf Of Peter Weil
Sent: Monday, July 25, 2022 9:25 PM
To: <EMAIL REMOVED> ; WebAIM Discussion List < <EMAIL REMOVED> >
Subject: Re: [WebAIM] Best practice for language markup

Murray, I would probably use the lang attribute in your case. Why? Transliterated words are still “in” their original language; but they are written in the Latin alphabet. That’s what transliteration
Caution: External ( <EMAIL REMOVED> <mailto: <EMAIL REMOVED> >)
First-Time Sender Details<https://protection.inkyphishfence.com/details?id=bmV0b3JnZnQxMDM2OTU1NC9qcEBqZXBlbHN5LmNvbS9mNjRjMWQ0OGEzYWY4OGM5Y2VjZmIyODdkMjJhYzM3NC8xNjU4ODAyMjk1LjUx#keyO9eda852ed1a7921b8060d43cdd04be>
Report This Email<https://protection.inkyphishfence.com/report?id=bmV0b3JnZnQxMDM2OTU1NC9qcEBqZXBlbHN5LmNvbS9mNjRjMWQ0OGEzYWY4OGM5Y2VjZmIyODdkMjJhYzM3NC8xNjU4ODAyMjk1LjUx#keyO9eda852ed1a7921b8060d43cdd04be> FAQ<https://www.inky.com/banner-faq> GoDaddy Advanced Email Security, Powered by INKY<https://www.inky.com/protection-by-inky>


I would probably use the lang attribute in your case. Why? Transliterated words are still “in” their original language; but they are written in the Latin alphabet. That’s what transliteration is. The purpose or value of transliteration is to make non-English words pronounceable to readers who are unfamiliar with the original (non-Latin) alphabet. Since one of the main purposes of the lang attribute is for better pronunciation, I would use it in this case, or at least test it. Which way is pronounced more accurately? With or without the lang attribute? Will the screen reader freak out because there is no Japanese alphabet to read, or will it attempt to read the word as if it were in Japanese, regardless of the alphabet?


> On Jul 25, 2022, at 8:11 PM, Murray Inman < <EMAIL REMOVED> <mailto: <EMAIL REMOVED> >> wrote:


> Friendly greetings!

> In an introductory Japanese course, there are several places where Japanese

> words are written out using "rōmaji" which basically is the

> pronunciation of the word written out using Roman characters. For example,

> The Japanese word *ローマ字* would be written as *rōmaji*.


> Would the best practice, both semantically and accessibility -wise, be to

> add the lang="ja" attribute to a wrapper <span> element? HTML code example:

> <span lang="ja">rōmaji</span>


> My thinking is that yes, it should have the lang attribute because it is a

> Japanese word. Anyone have any experience with the accessibility aspects of

> this?


> Thank you for your help!

> Murray



> Murray Inman


> Manager, Instructional Media and Accessibility


> VP, Ability Maricopa Employees with Disability Advocacy Group


> 480-517-8561 | <EMAIL REMOVED> <mailto: <EMAIL REMOVED> >


> RIO SALADO COLLEGE | https://riosalado.edu<https://shared.outlook.inky.com/link?domain=riosalado.edu&t=h.eJw1jkEOgyAUBa9iWDcgCIquvAr9fFotFQIYY5revbLo7iWTzLwP2ZMnU0OepcQ8MZaWkI03NlC0O7k15FXphiWkhyu87fpRKcnWOK8Y0eeTQngz10vgVmrTGac1jIDg7kIPVggD3SAZ75XWrRCjoopXLVZtxIKJHrj4-Vgy_JP2Ytvu_TVLPce_P-XRMck.MEUCIQDKxQL5XhqTHRV5sRLU07pABbU9FuMgi7nOrQ_4yQce-wIgdR2Y0tPwUZgo_muam_DmPUJpt4xgZ1MGQLHYkwFP0WE>


> 2323 West 14th Street, Tempe, AZ 85281


> Definition of "Accessible" <http://learnatrio.com/accessibilityDefined<;https://shared.outlook.inky.com/link?domain=learnatrio.com&t=h.eJwdjkEOgyAUBa9iWDciCIquXPQi-Pm0WIoGMMY0vXulu5dMZvI-ZI-ejBV55ryNlHrUMegc3VrD-qYaAFNys_Mun3e0LqAht4q8ihIwr_FhM2vabpBS0GWbFtzQp_Mv204AM0LpVlulYAAEO3PVG841tL2grJNKNZwPspasZLFkN8wY6wOdnw6XoEazF2YuFnbvr5nLY_b9AYilOhA.MEYCIQCl5zWNsIH8ScFoqBCni_ajiyF8HeCca0QZzlZ_6wsD8wIhANxDY6aKlOFJchLYDLzfkO0bbAd5-S70L3XCfDXm8lQ_>> by

> the Office for Civil Rights

> > > --

Peter Weil

Web Developer

University Marketing, University of Wisconsin–Madison