Bug#294265: horde2: Language selection preferences are ineffective if browser has a non-en default language

2005-02-10 Thread Ola Lundqvist
Hello

On Wed, Feb 09, 2005 at 06:56:51PM -0600, Gunnar Wolf wrote:
 Mensaje citado por Ola Lundqvist [EMAIL PROTECTED]:
 
   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.
 
 Today I haven't had any time to look into it, but I think it can be something
 gettext-related, as the language (as you note later on) is correctly set.

Probably.

   [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?
 
 Nope. This run was with the browser set to es-mx (hence it found the es_ES as
 the most adequate locale to show), and de_DE in my user preferences (which
 should have higher precedence than the browser's), and the interface still
 appears in English.
 
  Must also check that files in /usr/share/horde2/po
  has been properly generated.
 
  [EMAIL PROTECTED]:~# ls -l /usr/share/horde2/po/
  (...)
 
 It is correct down to the last bit :)

Good to know.

I'll see if I can reproduce it here.

If you find the cause, I'm very interested in knowing that.

Regards,

// Ola

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

-- 
 - Ola Lundqvist ---
/  [EMAIL PROTECTED] Annebergsslingan 37  \
|  [EMAIL PROTECTED] 654 65 KARLSTAD  |
|  +46 (0)54-10 14 30  +46 (0)70-332 1551   |
|  http://www.opal.dhs.org UIN/icq: 4912500 |
\  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]



Bug#294265: horde2: Language selection preferences are ineffective if browser has a non-en default language

2005-02-08 Thread gwolf
Package: horde2
Version: 2.2.7-1
Severity: important


When I use Horde from my regular environment (browser accepts languages
en-us,es-mx;q=0.5), i18n works perfectly with all the available languages.
However, if I set my browser to prefer as its primary language es_MX, it
presents only an English interface.

From the tests I have done, this happens also with basically any other
existing language I set up my browser to accept, except for English.

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.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-iiec
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages horde2 depends on:
ii  apache [httpd]1.3.33-3   versatile, high-performance HTTP s
ii  apache-ssl [httpd]1.3.33-3   versatile, high-performance HTTP s
ii  binutils  2.15-5 The GNU assembler, linker and bina
ii  debconf   1.4.30.11  Debian configuration management sy
ii  gettext   0.14.1-7   GNU Internationalization utilities
ii  libapache-mod-php4 [phpapi-20 4:4.3.10-2 server-side, HTML-embedded scripti
ii  logrotate 3.7-2  Log rotation utility
ii  make  3.80-9 The GNU version of the make util
ii  perl  5.8.4-5Larry Wall's Practical Extraction
ii  php4  4:4.3.10-2 server-side, HTML-embedded scripti
ii  php4-cgi [phpapi-20020918]4:4.3.10-2 server-side, HTML-embedded scripti
ii  php4-cli [phpapi-20020918]4:4.3.10-2 command-line interpreter for the p
ii  php4-pear 4:4.3.10-2 PEAR - PHP Extension and Applicati
ii  php4-pear-log 1.6.0-1.1  Log module for PEAR
ii  wwwconfig-common  0.0.42 Debian web auto configuration

-- debconf information:
* horde2/database_user: hordemgr
* horde2/welcome:
* horde2/databasemgr_port: 5432
* horde2/databasemgr_type: PostgreSQL
* horde2/database_name: horde2
  horde2/dbpgadmin: postgres
* horde2/databasemgr_server: localhost
  horde2/dbmyadmin: root
* horde2/webserver_type: Both




Bug#294265: horde2: Language selection preferences are ineffective if browser has a non-en default language

2005-02-08 Thread Ola Lundqvist
severity 294265 normal
thanks

On Tue, Feb 08, 2005 at 02:16:47PM -0600, [EMAIL PROTECTED] wrote:
 Package: horde2
 Version: 2.2.7-1
 Severity: important
 
 
 When I use Horde from my regular environment (browser accepts languages
 en-us,es-mx;q=0.5), i18n works perfectly with all the available languages.
 However, if I set my browser to prefer as its primary language es_MX, it
 presents only an English interface.
 
 From the tests I have done, this happens also with basically any other
 existing language I set up my browser to accept, except for English.
 
 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).

The language selection may be stored in a cookie, I have not checked
myself.

Regards,

// Ola

 -- System Information:
 Debian Release: 3.1
   APT prefers testing
   APT policy: (500, 'testing')
 Architecture: i386 (i686)
 Kernel: Linux 2.6.8-iiec
 Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
 
 Versions of packages horde2 depends on:
 ii  apache [httpd]1.3.33-3   versatile, high-performance HTTP 
 s
 ii  apache-ssl [httpd]1.3.33-3   versatile, high-performance HTTP 
 s
 ii  binutils  2.15-5 The GNU assembler, linker and 
 bina
 ii  debconf   1.4.30.11  Debian configuration management 
 sy
 ii  gettext   0.14.1-7   GNU Internationalization 
 utilities
 ii  libapache-mod-php4 [phpapi-20 4:4.3.10-2 server-side, HTML-embedded 
 scripti
 ii  logrotate 3.7-2  Log rotation utility
 ii  make  3.80-9 The GNU version of the make 
 util
 ii  perl  5.8.4-5Larry Wall's Practical Extraction
 ii  php4  4:4.3.10-2 server-side, HTML-embedded 
 scripti
 ii  php4-cgi [phpapi-20020918]4:4.3.10-2 server-side, HTML-embedded 
 scripti
 ii  php4-cli [phpapi-20020918]4:4.3.10-2 command-line interpreter for the 
 p
 ii  php4-pear 4:4.3.10-2 PEAR - PHP Extension and 
 Applicati
 ii  php4-pear-log 1.6.0-1.1  Log module for PEAR
 ii  wwwconfig-common  0.0.42 Debian web auto configuration
 
 -- debconf information:
 * horde2/database_user: hordemgr
 * horde2/welcome:
 * horde2/databasemgr_port: 5432
 * horde2/databasemgr_type: PostgreSQL
 * horde2/database_name: horde2
   horde2/dbpgadmin: postgres
 * horde2/databasemgr_server: localhost
   horde2/dbmyadmin: root
 * horde2/webserver_type: Both
 
 
 

-- 
 - Ola Lundqvist ---
/  [EMAIL PROTECTED] Annebergsslingan 37  \
|  [EMAIL PROTECTED] 654 65 KARLSTAD  |
|  +46 (0)54-10 14 30  +46 (0)70-332 1551   |
|  http://www.opal.dhs.org UIN/icq: 4912500 |
\  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]



Bug#294265: horde2: Language selection preferences are ineffective if browser has a non-en default language

2005-02-08 Thread Gunnar Wolf
  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.0 -0600
+++ /./usr/share/horde2/lib/Lang.php2005-02-08 16:04:21.0 -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




Bug#294265: horde2: Language selection preferences are ineffective if browser has a non-en default language

2005-02-08 Thread Ola Lundqvist
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