WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: webaim-forum-d Digest V2004 #76


From: Jukka K. Korpela
Date: Apr 24, 2004 7:28AM

On Fri, 23 Apr 2004, Kurt M Bendl wrote:

> If you are using something such as PHP, you "could" detect
> the language, and do conditionals inside your img tag to echo the
> appropriate content::

But this does not address the question of using two languages inside a
single alt attribute.

Besides, we know that the Accept-Language header sent by the browser
is very often wrong, in the sense of not corresponding to the user's real
preferences. People just don't know those settings exist, so they use
e.g. browser that by default sends Accept-Language: en.

Moreover, if you play with that header in your PHP code, make double sure
that your code handles e.g.
Accept-Language: de;q=0.1,en-GB;q=0.9,en
properly. It is very common to use far too simplistic processing for it.

> <?php
> if (!$bl) $LocalContent="";
> elseif ($bl=="it") $LocalContent="Italian words";
> elseif ($bl=="en") $LocalContent="English wordage";
> elseif ($bl=="de") $LocalContent="German words";
> else $LocalContent="";
> ?>

Not a good idea. If there is no match for the language, it is still better
to include _some_ content, maybe in simplified English.

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