WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Html Lang code for page

for

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

From: Joseph Sherman
Date: Tue, Dec 22 2015 10:01AM
Subject: Html Lang code for page
No previous message | Next message →

I know 3.1.1 The default human language of each Web page can be programmatically determined, but my web folk find this annoying on every page and web app, since it is all primary language English, and they tend to follow 3.1.2 for language of parts.

So question: Is 3.1.1 really critical in most cases? Is there a good reason I can offer for using it on every page? What happens when a Spanish screen reader user comes to an English page without a lang attribute? Does the software know to read in English?


Joseph

From: Lewis Phillips
Date: Tue, Dec 22 2015 10:06AM
Subject: Re: Html Lang code for page
← Previous message | Next message →

Screen readers use the language declaration to determine which voice to
use. Generally a screen reader has a default voice which includes how to
pronounce words.

So in your example a Spanish screen reader user on an English language page
without the declaration will have everything pronounced as if it was
Spanish. This would be very hard if not impossible to understand.

Lewis

On Tue, Dec 22, 2015 at 11:01 AM, Joseph Sherman < = EMAIL ADDRESS REMOVED = >
wrote:

> I know 3.1.1 The default human language of each Web page can be
> programmatically determined, but my web folk find this annoying on every
> page and web app, since it is all primary language English, and they tend
> to follow 3.1.2 for language of parts.
>
> So question: Is 3.1.1 really critical in most cases? Is there a good
> reason I can offer for using it on every page? What happens when a Spanish
> screen reader user comes to an English page without a lang attribute? Does
> the software know to read in English?
>
>
> Joseph
>
> > > > >

From: Steve Faulkner
Date: Tue, Dec 22 2015 10:07AM
Subject: Re: Html Lang code for page
← Previous message | Next message →

On 22 December 2015 at 17:01, Joseph Sherman < = EMAIL ADDRESS REMOVED = >
wrote:

> when a Spanish screen reader user comes to an English page without a lang
> attribute?


It will read the english with spanish pronunciations.

I am having trouble understanding why it is so tiresome to add lane="en" to
the HTML it's a copy and paste affair.
--

Regards

SteveF
Current Standards Work @W3C
<http://www.paciellogroup.com/blog/2015/03/current-standards-work-at-w3c/>;

From: Aaron Cannon
Date: Tue, Dec 22 2015 10:13AM
Subject: Re: Html Lang code for page
← Previous message | Next message →

You hit the reason (Or biggest reason) right on the nose. Another reason I've heard is so that search engines don't have to guess. Not sure that is true in practice, but it at least sounds plausable.

Aaron
--
This message was sent from a mobile device


> On Dec 22, 2015, at 11:01, Joseph Sherman < = EMAIL ADDRESS REMOVED = > wrote:
>
> I know 3.1.1 The default human language of each Web page can be programmatically determined, but my web folk find this annoying on every page and web app, since it is all primary language English, and they tend to follow 3.1.2 for language of parts.
>
> So question: Is 3.1.1 really critical in most cases? Is there a good reason I can offer for using it on every page? What happens when a Spanish screen reader user comes to an English page without a lang attribute? Does the software know to read in English?
>
>
> Joseph
>
> > > >

From: Adrian Roselli
Date: Tue, Dec 22 2015 10:14AM
Subject: Re: Html Lang code for page
← Previous message | Next message →

Joseph,

I tracked a bunch of ways that lang is used on a page [1]:

' VoiceOver on iOS uses the attribute to auto-switche voices.

' VoiceOver can speak a particular language using a different accent when
specified.

' Leaving out the lang attribute may require the user to manually switch to
the correct language for proper pronunciation.

'JAWS uses it to load the correct phonetic engine / phonologic dictionary —
Handy for sites with multiple languages.

' NVDA (Windows) uses it in the same way as VoiceOver and JAWS.

' When used in HTML that is used to form an ePub or Apple iBooks document,
it affects how VoiceOver will read the book.

' Firefox, IE10, and Safari (as of a year ago) only support CSS hyphens:
auto when the lang attribute is set.

Frankly, I believe it should be on every page. Since it can be set in a
global template, it should be a matter of setting it once and not worrying
until you find a rare case where you have to override it (which is good).

1: http://adrianroselli.com/2015/01/on-use-of-lang-attribute.html


On Tue, Dec 22, 2015 at 12:01 PM, Joseph Sherman < = EMAIL ADDRESS REMOVED = >
wrote:

> I know 3.1.1 The default human language of each Web page can be
> programmatically determined, but my web folk find this annoying on every
> page and web app, since it is all primary language English, and they tend
> to follow 3.1.2 for language of parts.
>
> So question: Is 3.1.1 really critical in most cases? Is there a good
> reason I can offer for using it on every page? What happens when a Spanish
> screen reader user comes to an English page without a lang attribute? Does
> the software know to read in English?
>
>
> Joseph
>
> > > > >

From: Joseph Sherman
Date: Tue, Dec 22 2015 10:17AM
Subject: Re: Html Lang code for page
← Previous message | Next message →

Thanks for all the replies, that's what I thought but it's always nice to have ammunition for the inevitable "Why do I have to do this" questions.


Joseph

-----Original Message-----
From: WebAIM-Forum [mailto: = EMAIL ADDRESS REMOVED = ] On Behalf Of Adrian Roselli
Sent: Tuesday, December 22, 2015 12:15 PM
To: WebAIM Discussion List
Subject: Re: [WebAIM] Html Lang code for page

Joseph,

I tracked a bunch of ways that lang is used on a page [1]:

' VoiceOver on iOS uses the attribute to auto-switche voices.

' VoiceOver can speak a particular language using a different accent when specified.

' Leaving out the lang attribute may require the user to manually switch to the correct language for proper pronunciation.

'JAWS uses it to load the correct phonetic engine / phonologic dictionary — Handy for sites with multiple languages.

' NVDA (Windows) uses it in the same way as VoiceOver and JAWS.

' When used in HTML that is used to form an ePub or Apple iBooks document, it affects how VoiceOver will read the book.

' Firefox, IE10, and Safari (as of a year ago) only support CSS hyphens:
auto when the lang attribute is set.

Frankly, I believe it should be on every page. Since it can be set in a global template, it should be a matter of setting it once and not worrying until you find a rare case where you have to override it (which is good).

1: http://adrianroselli.com/2015/01/on-use-of-lang-attribute.html


On Tue, Dec 22, 2015 at 12:01 PM, Joseph Sherman < = EMAIL ADDRESS REMOVED = >
wrote:

> I know 3.1.1 The default human language of each Web page can be
> programmatically determined, but my web folk find this annoying on
> every page and web app, since it is all primary language English, and
> they tend to follow 3.1.2 for language of parts.
>
> So question: Is 3.1.1 really critical in most cases? Is there a good
> reason I can offer for using it on every page? What happens when a
> Spanish screen reader user comes to an English page without a lang
> attribute? Does the software know to read in English?
>
>
> Joseph
>
> > > archives at http://webaim.org/discussion/archives
> >

From: Sundby, Valorie
Date: Tue, Dec 22 2015 10:23AM
Subject: Re: Html Lang code for page
← Previous message | Next message →

Follow-up Question: Does location ever influence AT when the lang attribute is not programmatically set? For example, when someone with a handheld device in Mexico loads a page vs. the same page being loaded in the United States?

Thanks,
Valorie

-----Original Message-----
From: WebAIM-Forum [mailto: = EMAIL ADDRESS REMOVED = ] On Behalf Of Joseph Sherman
Sent: Tuesday, December 22, 2015 10:17 AM
To: 'WebAIM Discussion List' < = EMAIL ADDRESS REMOVED = >
Subject: Re: [WebAIM] Html Lang code for page

Thanks for all the replies, that's what I thought but it's always nice to have ammunition for the inevitable "Why do I have to do this" questions.


Joseph

-----Original Message-----
From: WebAIM-Forum [mailto: = EMAIL ADDRESS REMOVED = ] On Behalf Of Adrian Roselli
Sent: Tuesday, December 22, 2015 12:15 PM
To: WebAIM Discussion List
Subject: Re: [WebAIM] Html Lang code for page

Joseph,

I tracked a bunch of ways that lang is used on a page [1]:

' VoiceOver on iOS uses the attribute to auto-switche voices.

' VoiceOver can speak a particular language using a different accent when specified.

' Leaving out the lang attribute may require the user to manually switch to the correct language for proper pronunciation.

'JAWS uses it to load the correct phonetic engine / phonologic dictionary — Handy for sites with multiple languages.

' NVDA (Windows) uses it in the same way as VoiceOver and JAWS.

' When used in HTML that is used to form an ePub or Apple iBooks document, it affects how VoiceOver will read the book.

' Firefox, IE10, and Safari (as of a year ago) only support CSS hyphens:
auto when the lang attribute is set.

Frankly, I believe it should be on every page. Since it can be set in a global template, it should be a matter of setting it once and not worrying until you find a rare case where you have to override it (which is good).

1: http://adrianroselli.com/2015/01/on-use-of-lang-attribute.html


On Tue, Dec 22, 2015 at 12:01 PM, Joseph Sherman < = EMAIL ADDRESS REMOVED = >
wrote:

> I know 3.1.1 The default human language of each Web page can be
> programmatically determined, but my web folk find this annoying on
> every page and web app, since it is all primary language English, and
> they tend to follow 3.1.2 for language of parts.
>
> So question: Is 3.1.1 really critical in most cases? Is there a good
> reason I can offer for using it on every page? What happens when a
> Spanish screen reader user comes to an English page without a lang
> attribute? Does the software know to read in English?
>
>
> Joseph
>
> > > archives at http://webaim.org/discussion/archives
> >
---------------------------------------------------------------------------
The information in this email may be confidential and is the
property of 5280 Solutions LLC. Access to this email by
anyone other than the intended recipient(s) is unauthorized.
Forwarding, copying or reproduction of confidential
information without the express permission of 5280 Solutions
LLC is strictly prohibited. If you have received this
communication in error, please contact the sender
immediately (by reply email) and delete the confidential
information from any computer immediately.
---------------------------------------------------------------------------

From: Roger Hudson
Date: Tue, Dec 22 2015 1:01PM
Subject: Re: Html Lang code for page
← Previous message | Next message →

Joseph, it might be worth reminding the developers that English may not be the first language for every screen reader user in an English speaking country (for example) and some of these people will use their first language (Spanish for example) as the default language for their technology. In this case, if there is no lang="en", all the 'English' will sound strange and with some languages incomprehensible.
Regards,
Roger

-----Original Message-----
From: Steve Faulkner [mailto: = EMAIL ADDRESS REMOVED = ]
Sent: Wednesday, 23 December 2015 4:08 AM
To: WebAIM Discussion List
Subject: Re: [WebAIM] Html Lang code for page

On 22 December 2015 at 17:01, Joseph Sherman < = EMAIL ADDRESS REMOVED = >
wrote:

> when a Spanish screen reader user comes to an English page without a
> lang attribute?


It will read the english with spanish pronunciations.

I am having trouble understanding why it is so tiresome to add lane="en" to the HTML it's a copy and paste affair.
--

Regards

SteveF
Current Standards Work @W3C
<http://www.paciellogroup.com/blog/2015/03/current-standards-work-at-w3c/>;

From: Patrick H. Lauke
Date: Tue, Dec 22 2015 1:49PM
Subject: Re: Html Lang code for page
← Previous message | Next message →

On 22/12/2015 17:01, Joseph Sherman wrote:
> I know 3.1.1 The default human language of each Web page can be programmatically determined, but my web folk find this annoying on every page and web app, since it is all primary language English, and they tend to follow 3.1.2 for language of parts.

So let me get this right: the developers are finding it too annoying to
add a single lang attribute on the html element for 3.1.1

<html lang="en">

but they tend to follow 3.1.2, meaning that for each passage or phrase,
they're explicitly specifying the language, so presumably doing
something like

<div lang="en">...</div>
<p lang="en">...</div>

etc? If they AREN'T doing the latter, then no they're not following
3.1.2 in that case (as in the absence of a default language set for the
whole page, you must add it explicitly to every container/bit of content
in order to still fulfill 3.1.2)...

P
--
Patrick H. Lauke

www.splintered.co.uk | https://github.com/patrickhlauke
http://flickr.com/photos/redux/ | http://redux.deviantart.com
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: Birkir R. Gunnarsson
Date: Tue, Dec 22 2015 5:21PM
Subject: Re: Html Lang code for page
← Previous message | No next message

Screen reader users can configure their screen reader to detect
webpage lang attributes and load the appropriate language or
synthesizer (if one is installed), this is the default setting for
most screen readers.
Users can also configure the screen reader to read all content with a
default language unless the user manually switches the screen reader
language.

I gave up on my screen reader language detection setting some time ago.
I subscribe to a number of European mailing lists, and I discovered
that many email programs apply the national language of the sender to
the email content, whilst most email communications on European
mailing lists takes place in English.
After trying to comprehend English emails using French, Spanish,
German, Swedish and Italian speech synthesizers I eventually gave up
on the auto detect language setting.

I am not encouraging people to leave out the language tag (this is the
easiest WCAG success criterion in my opinion), rather stressing the
importance of making sure the right language tag is used, and
reminding people that automated software can only detect the presence
of a language tag, but cannot determine if that tag is correct for the
content.
With all the language translation and analysis services out there this
is probably possible by now.
Cheers

-B


On 12/22/15, Patrick H. Lauke < = EMAIL ADDRESS REMOVED = > wrote:
> On 22/12/2015 17:01, Joseph Sherman wrote:
>> I know 3.1.1 The default human language of each Web page can be
>> programmatically determined, but my web folk find this annoying on every
>> page and web app, since it is all primary language English, and they tend
>> to follow 3.1.2 for language of parts.
>
> So let me get this right: the developers are finding it too annoying to
> add a single lang attribute on the html element for 3.1.1
>
> <html lang="en">
>
> but they tend to follow 3.1.2, meaning that for each passage or phrase,
> they're explicitly specifying the language, so presumably doing
> something like
>
> <div lang="en">...</div>
> <p lang="en">...</div>
>
> etc? If they AREN'T doing the latter, then no they're not following
> 3.1.2 in that case (as in the absence of a default language set for the
> whole page, you must add it explicitly to every container/bit of content
> in order to still fulfill 3.1.2)...
>
> P
> --
> Patrick H. Lauke
>
> www.splintered.co.uk | https://github.com/patrickhlauke
> http://flickr.com/photos/redux/ | http://redux.deviantart.com
> twitter: @patrick_h_lauke | skype: patrick_h_lauke
> > > > >


--
Work hard. Have fun. Make history.