Hello

On Tue, Feb 08, 2005 at 04:30:07PM -0600, [EMAIL PROTECTED] wrote:
> > > 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

Nice. I thought it would be something like that. I wonder why it fail
anyway.

> 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
This looks good so far.

> [Tue Feb  8 16:25:31 2005] [error] setLang(de_DE)
> [Tue Feb  8 16:25:31 2005] [error] isValid(de_DE): 1
No select? Hmm.

> [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

Ok. Do the interface work in non-english now?

> 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

Seems like the prowser have preference over anything.

Must also check that files in /usr/share/horde2/po
has been properly generated.

[EMAIL PROTECTED]:~# ls -l /usr/share/horde2/po/
totalt 1024
-rw-r--r--  1 root root 38340 2003-08-05 23:52 ar_SY.po
-rw-r--r--  1 root root 14735 2002-07-24 18:24 bg_BG.po
-rw-r--r--  1 root root 16875 2003-02-19 18:19 ca_ES.po
-rw-r--r--  1 root root 15741 2002-05-30 18:49 cs_CZ.po
-rw-r--r--  1 root root 19111 2003-08-15 22:36 da_DK.po
-rw-r--r--  1 root root 44987 2004-07-28 12:41 de_DE.po
-rw-r--r--  1 root root 16466 2002-12-02 09:55 el_GR.po
-rw-r--r--  1 root root 20007 2004-04-26 19:49 es_ES.po
-rw-r--r--  1 root root 17896 2004-06-01 10:48 et_EE.po
-rw-r--r--  1 root root   910 2001-09-14 22:03 extract.pl
-rw-r--r--  1 root root 36450 2004-03-03 21:42 fi_FI.po
-rw-r--r--  1 root root 45015 2003-08-07 22:55 fr_FR.po
-rw-r--r--  1 root root 17269 2003-12-10 15:10 gl_ES.po
-rw-r--r--  1 root root 30940 2004-07-28 12:42 horde.pot
-rw-r--r--  1 root root 28703 2004-02-29 23:47 hu_HU.po
-rw-r--r--  1 root root 19703 2004-01-10 17:04 id_ID.po
-rw-r--r--  1 root root 15951 2003-11-14 19:02 it_IT.po
-rw-r--r--  1 root root 14284 2002-04-06 17:26 ja_JP.po
-rw-r--r--  1 root root 22322 2002-12-27 16:34 ko_KR.po
-rw-r--r--  1 root root 25962 2002-08-23 01:39 lt_LT.po
-rw-r--r--  1 root root 14196 2002-12-01 14:08 lv_LV.po
-rw-r--r--  1 root root  1137 2002-05-20 19:36 Makefile
-rw-r--r--  1 root root 14920 2003-06-28 01:48 mk_MK.po
-rw-r--r--  1 root root 14958 2003-04-28 18:20 nb_NO.po
-rw-r--r--  1 root root 19761 2004-01-19 00:22 nl_NL.po
-rw-r--r--  1 root root 38017 2003-04-11 13:37 nn_NO.po
-rw-r--r--  1 root root 19006 2003-04-10 17:05 pl_PL.po
-rw-r--r--  1 root root 22089 2003-06-08 00:42 pt_BR.po
-rw-r--r--  1 root root 40400 2004-03-30 23:03 pt_PT.po
-rw-r--r--  1 root root  5776 2003-03-20 12:29 README
-rw-r--r--  1 root root 14694 2002-11-07 16:51 ro_RO.po
-rw-r--r--  1 root root 42812 2003-06-01 11:41 ru_RU.KOI8-R.po
-rw-r--r--  1 root root 42812 2003-11-18 15:29 ru_RU.po
-rwxr-xr-x  1 root root 23733 2001-07-04 20:28 shtool
-rw-r--r--  1 root root 43268 2004-08-28 13:38 sk_SK.po
-rw-r--r--  1 root root 27647 2004-09-02 12:19 sl_SI.po
-rw-r--r--  1 root root 37388 2003-08-06 00:04 sv_SE.po
-rwxr-xr-x  1 root root 44245 2004-03-30 19:43 translation.php
-rw-r--r--  1 root root 11837 2002-01-10 10:14 uk_UA.po
-rwxr-xr-x  1 root root   663 2002-04-06 18:44 wintokoi.pl
-rw-r--r--  1 root root    86 2001-06-18 06:25 xgettext.sh
-rw-r--r--  1 root root 12035 2002-05-25 12:40 zh_CN.po
-rw-r--r--  1 root root 15868 2003-05-05 10:39 zh_TW.po
[EMAIL PROTECTED]:~# 

Should look similar.

If not, something went wrong during installation (postinst).

You can generate them again by entering that dir and run make.

Regards,

// Ola

> 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]);
>      }
> 
> 
> 

-- 
 --- Ola Lundqvist systemkonsult --- M Sc in IT Engineering ----
/  [EMAIL PROTECTED]                   Annebergsslingan 37        \
|  [EMAIL PROTECTED]                   654 65 KARLSTAD            |
|  http://www.opal.dhs.org           Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
 ---------------------------------------------------------------


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to