[imp] Language selection from browser setting

Jan Schneider jan@horde.org
Fri, 21 Dec 2001 12:27:33 +0100


Zitat von Antonio Dias <accdias@sst.com.br>:

> Guys,
> 
> Definitly there is a problem horde/lib/Lang.php->Lang::_map(). I
> inserted a lot of echo() in Lang::_map() to trace the error and found
> an
> odd behaviour when the browser is set to a country code with "-" in it.
> It doesn't return the correct code even if the country is valid Horde
> country code. The modified function and respective output is at
> <http://storm.sst.com.br/trace.txt> and I ask you please to take a look
> on it.

I couldn't reproduce though my browser also sent de-de, en-us;q=0.50

I changed the _map() method to return the translated locale instead what 
the browser sent if it can't find a valid mapping, e.g. pt_BR instead of pt-
BR. Try if it works now.

Jan.

::::::::::::::::::::::::::::::::::::::::
AMMMa AG - discover your knowledge
:::::::::::::::::::::::::::
Detmolder Str. 25-33 :: D-33604 Bielefeld
fon +49.521.96878-0 :: fax  +49.521.96878-20
http://www.ammma.de
::::::::::::::::::::::::::::::::::::::::::::::