WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: AT and ALT text in different languages

for

From: Jukka K. Korpela
Date: Mar 6, 2011 11:00PM


Webb, KerryA wrote:

>> There's been a complaint about this page:
>> http://votensw.info/enrolment
>>
>> They pointed out that the images in the various languages have
>> English ALT text.

They also have English TITLE text.

>> Can anyone suggest how this could be remedied so that AT would read
>> out the text in the appropriate language?

The ALT and TITLE texts should be replaced by texts in the applicable
language, i.e. the texts appearing in the images. (I would omit the TITLE
attributes as pointless, but that's a different issue and somewhat
debatable.)

For example, in the image containing the Italian text, the ALT attribute
should be
alt="Mettete il vostro nome nelle liste per votare alle elezioni".

> Just after I posted this, I found a reference to the use of the
> "lang" attribute, which would seem to fill the bill. I assume that
> you could put this in the <img> element.

You can put the lang attribute in an img element, but it surely does not
cause any translation. It would make things worse, in the rare cases where
some software interprets the attribute according to its defined meaning and
makes use of it. The attribute is declarative: it announces the language
used in the element's content and attributes - in this case, the image, the
ALT attribute, and the TITLE attribute. So if interpreted and used properly,
e.g. lang="it" in an <img> element would cause the text to be read according
to the rules of Italian, and if the text is in fact English, the result
would be... rather strange. You can, and in principle should, use lang="it"
after changing the attribute contents to Italian, though it will probably
affect very few programs.

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