[Bug 906] New - locale issues with MSIE6

bugs@bugs.horde.org bugs@bugs.horde.org
Sat, 16 Mar 2002 09:14:50 -0400


http://bugs.horde.org/show_bug.cgi?id=906

*** shadow/906	Sat Mar 16 09:14:50 2002
--- shadow/906.tmp.23574	Sat Mar 16 09:14:50 2002
***************
*** 0 ****
--- 1,36 ----
+ Bug#: 906
+ Product: Horde
+ Version: 2.1 Unstable
+ Platform: MSIE 5
+ OS/Version: All
+ Status: NEW   
+ Resolution: 
+ Severity: normal
+ Priority: P2
+ Component: IMP
+ Area: BUILD
+ AssignedTo: chuck@horde.org                            
+ ReportedBy: dom@http.org               
+ URL: 
+ Summary: locale issues with MSIE6
+ 
+ The date header formatting in IMP's mailbox.php uses strftime() which relies on 
+ setlocale() being correct. This is set by Lang::setLang().
+ 
+ MSIE 6.0 (at least that is what I am testing on) sends 'en-gb' as the 
+ HTTP_ACCEPT_LANGUAGE header (which is converted to 'en_gb' by Lang::_map.
+ 
+ The horde/config/lang.php file contains 'en_GB' but not 'en_gb', so 
+ Lang::isValid does not return positive.
+ 
+ So we either need to propogate lang.php with all the lower-case equivalents 
+ (not good!) or reformat the browser header value to something more standard.
+ 
+ The following addition to Lang::_map fixes the problem:
+ 
+   // Translate the $language to get broader matches
+   // eg. de-DE should match de_DE
+   $trans_lang = str_replace('-', '_', $language);
+   $trans_lang = explode("_", $trans_lang);
+   $trans_lang = $trans_lang[0] . "_" . strtoupper($trans_lang[1]);
+