Hy Philip,

I would expect to have the locale within the session.
There is no need of grabbing the locale from Registry or Cache or to recreate it if you have the locale in your session.

Btw: You dont need to give the locale-object... it's enough to give the locale-definition-string... f.e. "en_US" instead of the instance.

Related to Zend_Locale::FRAMEWORK...
This work is stopped until we have Zend_Environment which was proposed to store framework-wide settings.

Greetings
Thomas
I18N Team Leader


----- Original Message ----- From: "Philip Iezzi" <[EMAIL PROTECTED]>
To: "Thomas Weidner" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Saturday, July 07, 2007 3:48 PM
Subject: Re: [fw-general] configure default Zend_Locale for Zend_Date


Hi Thomas,

Thanks for your solution. This is not really appropriate as I initiate a lot of Zend_Date instances and it would be a huge code change. I'd prefer to set a default locale for the whole framework in my bootstrap instead of grabbing the locale in each controller from Zend_Registry / Zend_Cache and change all those Zend_Date initializations. If currently there is no simply solution for this, I hope someone is working on Zend_Locale::FRAMEWORK as described in:
http://framework.zend.com/manual/en/zend.locale.html#zend.locale.selection
That would be wonderful!

Regards,
Philip


Thomas Weidner wrote:
Hy Philip,

you just have to do:

$locale = new Zend_Locale(Zend_Locale::ENVIRONMENT);
$date = new Zend_Date($locale);

Just get sure that you store your locale, f.e. within Zend_Cache
and initiate every date instance with the given locale.

This way you override the standard settings from your clients browsers.

Greetings
Thomas
I18N Team Leader

----- Original Message ----- From: "Philip Iezzi" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, July 07, 2007 1:04 PM
Subject: [fw-general] configure default Zend_Locale for Zend_Date


This may have been discussed earlier on this list but I cannot find
the thread...

How do I configure a default locale for all Zend_Date instances?
I need to override browser detection (Zend_Locale::BROWSER) as wget
does not seem to provide any HTTP_ACCEPT_LANGUAGE environment variable.
Is there a way to set the default locale by PHP's setlocale() in
combination with Zend_Locale::ENVIRONMENT or is Zend_Locale::FRAMEWORK
already implemented in ZF 1.0 ? Setting component defaults is a must
for ZF, in my eyes.

If there is currently no way to do this, can anybody pls tell me how
to set HTTP_ACCEPT_LANGUAGE for wget on a Debian Etch system?

Thanks a lot
Philip

Reply via email to