According to manual and API doc the locale is "automatically detected" when you omit it at initialisation. But when you want to use the default fallback locale instead of the locale which is detected by looking at the clients browser then you should use Zend_Locale::ZFFEDAULT as locale instead of omitting it.

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

----- Original Message ----- From: "Jonathan Maron" <jonathan.a.ma...@gmail.com>
To: <fw-general@lists.zend.com>
Sent: Thursday, May 28, 2009 1:14 PM
Subject: [fw-general] Setting default Locale in application.(ini|xml)


Hello all

When I try to set the default locale in application.xml with the following:

<production>
<resources>
<locale>
<default>de_DE</default>
</locale>
</resources>
</production>

Nothing happens: The locale-aware classes are NOT aware of the default locale.

Line 64 of 'library/Zend/Application/Resource/Layout.php' the
following *is* is called:

Zend_Locale::setDefault($options['default']);

However, the default value is not set.

$options['default'] contains 'de_DE';

It is necessary to change line 66:

$this->_locale = new Zend_Locale();

to:

$this->_locale = new Zend_Locale($options['default']);

In order that the default is set and other locale-aware classes are
really aware of the default.

Am I missing something obvious here?

I am using ZF 1.8.2.

Jonathan Maron

Reply via email to