Eigher you use browser settings which means that you stick on HTTP_ACCEPT_LANGUAGE
or you stick with environment, which means LC_ALL.

The browser uses the locale 'browser' within Zend_Locale.
Also Zend_Locale has no getList() method.

As you mentioned "Registry Locale"... do you mean setting the Zend_Locale object to Zend_Registry with the key Zend_Locale ? This is named "Application wide locale" and available with 1.7. This will not work in 1.6.2. You can read about this here: http://framework.zend.com/manual/en/zend.translate.using.html#zend.translate.using.languages.automatic

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "Robert Castley" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, November 12, 2008 3:34 PM
Subject: [fw-general] Problem with Zend_Locale, UTF-8, setLocale on Windows


Hi,

It seems that in 1.6.2 Zend_Locale doesn't handle well under Windows.

Zend_Locale is using

$language = setlocale(LC_ALL, 0);

in the getEnvironment function

Using the same browser to access two systems I get:

On my Windows  ZF system this will return:
Array

(

   [0] => LC_COLLATE=C

   [1] => LC_CTYPE=English_United Kingdom.1252

   [2] => LC_MONETARY=C

   [3] => LC_NUMERIC=C

   [4] => LC_TIME=C

)


On my Linux ZF system this will return:

Array

(

   [0] => C

)


Now running my language debugger I see the following:

Windows System:


_SERVER["HTTP_ACCEPT_LANGUAGE"]=de-at,de;q=0.7,en-gb;q=0.3



Registry contains:

Display getList():

Array

(

   [en] => en

   [de] => de

   [es] => es

   [fr] => fr

   [it] => it

)

Translate save: Save

Registry Locale: en


On Windows it is failing to detect the correct Browser Language setting.

Using the same browser and pointing at a Linux system I get:


_SERVER["HTTP_ACCEPT_LANGUAGE"]=de-at,de;q=0.7,en-gb;q=0.3



Registry contains:

Display getList():

Array

(

   [de] => de

   [en] => en

   [es] => es

   [fr] => fr

   [it] => it

)

Translate save: Speichern

Registry Locale: de


Which is correct!

The only thing I could find on Google was this which handles setting the
character set for Linux and the codepage for Windows:

https://code.zikula.org/svn/core/development/zikula-1/includes/pnLang.php
<https://code.zikula.org/svn/core/development/zikula-1/includes/pnLang.php>

Look in the function pnSetLocale.

- Robert




________________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email Security Service and the Macro 4 plc internal virus protection system. ________________________________________________________________________

Reply via email to