By the way you can set the locale string in the constructor. This works in
the bootstrap file

                $locale = new Zend_Locale('en_US');
                Zend_Registry::set('Zend_Locale', $locale);

I get the issue when I try to overwrite the value in my controllers


asagala wrote:
> 
> 
> That still doesnt work. 
> 
> 
> thomasW wrote:
>> 
>> According to manual the registry key 'Zend_Locale' has to be an instance
>> of 
>> Zend_Locale.
>> 'fr_CA' may be a locale, but it's not an instance of Zend_Locale.
>> 
>> So when you want to change the application wide locale afterwards you
>> need 
>> to change the instance and not the registry content.
>> 
>> $locale = Zend_Registry::get('Zend_Locale');
>> $locale->setLocale('fr_CA');
>> Zend_Registry::set('Zend_Locale', $locale);
>> 
>> Because giving a string does not overwrite the content of the set
>> instance.
>> 
>> Greetings
>> Thomas Weidner, I18N Team Leader, Zend Framework
>> http://www.thomasweidner.com
>> 
>> 
>> ----- Original Message ----- 
>> From: "asagala" <[email protected]>
>> To: <[email protected]>
>> Sent: Friday, November 06, 2009 5:32 PM
>> Subject: Re: [fw-general] Zend_Locale
>> 
>> 
>>>
>>>
>>> Also tried this
>>> $locale = new Zend_Locale('fr_CA');
>>> Zend_Registry::set('Zend_Locale', 'fr_CA');
>>>
>>>
>>> asagala wrote:
>>>>
>>>> Hi,
>>>>
>>>> I am currently having an issue with Zend_Locale. I am initializing the
>>>> default in my bootstrap like this
>>>>
>>>> protected function _initLocale()
>>>> {
>>>> $locale = new Zend_Locale('en_US');
>>>> Zend_Registry::set('Zend_Locale', $locale);
>>>>
>>>>     return $locale;
>>>> }
>>>>
>>>> and this works fine. However when I try and change the value of the 
>>>> locale
>>>> in my controllers the initial value is not overwritten. Here is how I
>>>> am
>>>> writting the new value to the Zend_Locale key in my controllers
>>>>
>>>> Zend_Registry::set('Zend_Locale','fr_CA');
>>>>
>>>> Anyone have a clue?
>>>>
>>>
>>> -- 
>>> View this message in context: 
>>> http://old.nabble.com/Zend_Locale-tp26230812p26230819.html
>>> Sent from the Zend Framework mailing list archive at Nabble.com. 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Zend_Locale-tp26230812p26302847.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to