WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Best practice for language markup

for

Number of posts in this thread: 4 (In chronological order)

From: Murray Inman
Date: Mon, Jul 25 2022 7:11PM
Subject: Best practice for language markup
No previous message | Next message →

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 ADDRESS REMOVED =

RIO SALADO COLLEGE | https://riosalado.edu

2323 West 14th Street, Tempe, AZ 85281

Definition of "Accessible" <http://learnatrio.com/accessibilityDefined>; by
the Office for Civil Rights

From: glen walker
Date: Mon, Jul 25 2022 7:45PM
Subject: Re: Best practice for language markup
← Previous message | Next message →

Except that the text within your <span> is not Japanese, it's English, sort
of. Similar to how Pidgen for Chinese isn't straight English.

Phonetic alphabets aren't really a language but it looks like you might be
able to have a "fonipa" suffix on the lang attribute.

https://www.rfc-editor.org/rfc/rfc5646.html

I'm not sure if it does anything for screen readers. That *might* mean you
could have "jp-fonipa" as the language. I'm not sure but perhaps worth
investigating further.

If you had real Japanese characters in the <span>, such as the ローマ字 you
listed earlier, then that should have "jp" as the language.

Let us know if you try various combinations and can hear the screen reader
change accents.

From: Peter Weil
Date: Mon, Jul 25 2022 8:24PM
Subject: Re: Best practice for language markup
← Previous message | Next message →

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 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?

Peter

> On Jul 25, 2022, at 8:11 PM, Murray Inman < = EMAIL ADDRESS 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 ADDRESS REMOVED =
>
> RIO SALADO COLLEGE | https://riosalado.edu
>
> 2323 West 14th Street, Tempe, AZ 85281
>
> Definition of "Accessible" <http://learnatrio.com/accessibilityDefined>; by
> the Office for Civil Rights
> > > > --
Peter Weil
Web Developer
University Marketing, University of Wisconsin–Madison
608-220-3089

From: jp Jamous
Date: Tue, Jul 26 2022 5:45AM
Subject: Re: Best practice for language markup
← Previous message | No next message

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 ADDRESS REMOVED = > On Behalf Of Peter Weil
Sent: Monday, July 25, 2022 9:25 PM
To: = EMAIL ADDRESS REMOVED = ; WebAIM Discussion List < = EMAIL ADDRESS 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 ADDRESS REMOVED = <mailto: = EMAIL ADDRESS 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>


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 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?



Peter



> On Jul 25, 2022, at 8:11 PM, Murray Inman < = EMAIL ADDRESS REMOVED = <mailto: = EMAIL ADDRESS 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 ADDRESS REMOVED = <mailto: = EMAIL ADDRESS 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

608-220-3089