WebAIM - Web Accessibility In Mind

E-mail List Archives

RE: alt text in 2 languages?

for

From: Jukka K. Korpela
Date: Apr 22, 2004 8:32PM


On Thu, 22 Apr 2004 <EMAIL REMOVED> wrote:

> Using, <p lang="en">My name is John.</p> and <p lang="fr">Je m'appelle
> Jean.</p>, JAWS read both paragraphs using the proper pronunciation of the
> words.

Excellent. This helps us to convince authors to use (correct) lang
attributes. The basic idea is simple, but it has been difficult to answer
the question "why bother?".

Since most documents are in one language, I guess the most important part
is to specify the overall language, which is very simply: just put a lang
attribute into the <html> tag. This should make speech synthesis
automatically select the right mode if possible, so that the user does not
need to do the switching manually when moving from one document to
another.

If there are longish pieces of text in a different language, say the
French title of a book you're citing, then it should be marked up using a
suitable lang attribute. This is usually simple and fast too. But for the
best quality, quite some extra work might be needed.

And it's not clear cut what gives the best quality. Consider, for
example, the question "Have you seen Jean's new book?" when
"Jean" refers to a Frenchman. Logically, it seems, this should be marked
up using
Have you seen <span lang="fr">Jean</span>'s new book?
since only the name itself is French, the 's is the genitive suffix in
English. This in turn may cause a break in speech synthesis between the
word and the suffix.

Authoring programs may automatically insert lang attributes, but not
necessarily the right one, e.g. automatically using lang=""en". And
naturally a _wrong_ lang attribute is worse than no lang attribute.

FrontPage, for example, seems to insert a meta tag with
http-equiv="Content-Language" according to its own language settings.
Whether this means specifying the _right_ language depends on whether the
user has selected the right language in the settings, and this is probably
not known to many authors using FP. They have however good reasons for
doing so, since the language settings affect spell checking, so if a wrong
language has been selected, most words will appear with red underlining
(in FP, not on the page itself) indicating suspected misspelling. But
authors might not realize this, and might even have disabled spell
checking as "annoying". Spelling checks are an important accessibility
issue on their own, too, since they directly affect the readability,
especially to people with reading difficulties. (Besides, in speech
synthesis a typo often have drastic effects.)

I wonder if the meta tag - which is in principle the wrong way to indicate
language, though not very wrong - affects JAWS, or HPR, in the absence of
lang attributes. (FrontPage does recognize lang attributes too, and gives
them priority over the meta tag. But FP does not make it too easy to
authors to set lang attributes. In effect, the author needs to manipulate
them at the markup level directly, contrary to the overall wysiwyg style
of authoring that dominates in FP usage.)

Somewhat similar considerations apply to MS Word. When an author has
selected the language settings and has set the language of foreign words
as well, then, upon saving the document as HTML (a debatable move, though
it produces tolerable results when using the filter that removes a lot of
Office-specific code) the language information is reflected in lang
attributes in the generated HTML code.

But I wonder whether JAWS or other programs, when reading MS Word
documents, can utilize the language information in the Word format.

One more question: when reading XHTML documents, do they recognize
both lang and xml:lang attributes? (This xml:lang thing has caused some
confusion, and authors who wish to swear by the most recent
recommendations might wish to use both lang and xml:lang, which is boring
to them, or, being very "modern", to use xml:lang only, perhaps missing
the actual benefits of language markup since this attribute might not be
recognized.)

--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/


----
To subscribe, unsubscribe, suspend, or view list archives,
visit http://www.webaim.org/discussion/