> > I have been trying to find the point where the language selection goes
> > crazy (as the right strings do appear at a first debugging glance), will
> > follow up this bug report if I find anything.
>
> Ok. Well I have not checked that. Maybe I should as I use the Swedish
> language but I have not noticed it really.
>
> Are you referring to the initial page or all the other ones (you
> will be prompted at login (initial page).
It happens in all of the system, even if you specifically ask for a different
one.
> The language selection may be stored in a cookie, I have not checked
> myself.
It is in fact more complicated. Take a look at Lang::select
(/usr/share/horde2/lib/Lang.php), the steps seem to be:
- Is the language set in the preferences?
- Did the user select a language at login?
- Is there a language set in the cookie?
- Does the browser supply a list of accepted languages? If so, is any of them
valid, or can you match the first two letters of any of them to a valid one?
- Get the default configured value
Now... I am no PHP man, but I did set up some debugging error_log() calls here
and there - I am quoting you here how are functions select(), setLang() and
isValid() in Lang.php for a inbox view. My browser is set to es-mx, and I have
de_DE in my preferences. Interface appears, of course, in English:
[Tue Feb 8 16:25:31 2005] [error] setLang()
[Tue Feb 8 16:25:31 2005] [error] isValid(es_MX):
[Tue Feb 8 16:25:31 2005] [error] isValid(es_ES): 1
[Tue Feb 8 16:25:31 2005] [error] select(): es_ES
[Tue Feb 8 16:25:31 2005] [error] setLang(de_DE)
[Tue Feb 8 16:25:31 2005] [error] isValid(de_DE): 1
[Tue Feb 8 16:25:32 2005] [error] setLang()
[Tue Feb 8 16:25:32 2005] [error] isValid(es_MX):
[Tue Feb 8 16:25:32 2005] [error] isValid(es_ES): 1
[Tue Feb 8 16:25:32 2005] [error] select(): es_ES
Now, if I switch the browser to en_US, it looks quite similar:
[Tue Feb 8 16:26:48 2005] [error] setLang()
[Tue Feb 8 16:26:48 2005] [error] isValid(en_US): 1
[Tue Feb 8 16:26:48 2005] [error] select(): en_US
[Tue Feb 8 16:26:48 2005] [error] setLang(de_DE)
[Tue Feb 8 16:26:48 2005] [error] isValid(de_DE): 1
[Tue Feb 8 16:26:48 2005] [error] setLang()
[Tue Feb 8 16:26:48 2005] [error] isValid(en_US): 1
[Tue Feb 8 16:26:48 2005] [error] select(): en_US
In case it is worth anything, here goes the diff I have, inserting the error_log
calls:
--- ./usr/share/horde2/lib/Lang.php 2003-01-17 04:22:14.000000000 -0600
+++ /./usr/share/horde2/lib/Lang.php 2005-02-08 16:04:21.000000000 -0600
@@ -57,6 +57,7 @@
$language = $nls['defaults']['language'];
}
+ error_log('select(): ' . basename($language));
return basename($language);
}
@@ -68,6 +69,7 @@
*/
function setLang($lang = null)
{
+ error_log("setLang($lang)");
if (@file_exists(HORDE_BASE . '/config/lang.php')) {
include_once HORDE_BASE . '/config/lang.php';
} else {
@@ -126,6 +128,7 @@
*/
function isValid($language)
{
+ error_log("isValid($language): " .
!empty($GLOBALS['nls']['languages'][$language]));
return !empty($GLOBALS['nls']['languages'][$language]);
}
--
Gunnar Wolf - [EMAIL PROTECTED] - (+52-55)1451-2244 / 5554-9450
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF