>From the doc, it seems that Zend_Locale::setDefault() does the same :

[...] $date = new Zend_Date($locale); But this has one big negative effect.
You will have to set your locale object within every class using
Zend_Locale. This could become very unhandy if you are using multiple
classes.
Since Zend Framework Release 1.5 there is a much better way to handle this.
You can set a default locale which the static setDefault() method. Of
course, every unknown or not fully qualified locale will also throw an
exception. setDefault() should be the first call before you initiate any
class using Zend_Locale. See the following example for details:
// within the bootstrap file
Zend_Locale::setDefault('de');
 
// within your model/controller
$date = new Zend_Date();

As you see, in the example code above, they set the default locale, then in
some *other* class, create a date which would use the locale specified in
Zend_Locale::setDefault().

It doesn't work for me. But I may understand something wrong, as I don't see
any difference between Zend_Locale::setDefault and the Zend_Locale value in
Registry as it is explained in the doc.
-- 
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/How-to-make-Zend-Locale-setDefault-locale-work-tp2713941p2713960.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to