I18N compatibility mode
- Posted by thomasw at 23:03:34 // //
- Announcements, File Transfer, Locale
Hy interested ones,
to prevent problems when you want to change from Zend Framework 1.6 to 1.7 I added a so called “compatibility mode”.
It’s simply a static variable which changes between old API and new API behaviour.
Within release 1.7 the old behaviour is per default active (true).
So your old code will still work with this settings but it will throw a user warning.
You can change this mode by simply setting it to false in your bootstrap.
Zend_Locale::$compatibilityMode = false;
This will no longer return user warnings, but could be in a position where you have to change your code to work again. See the migration chapter of Zend_Locale for details.
The changes include:
* changes on isLocale which now only returns boolean
* changes on getDefault which returns only the framework default
* changes on calling information methods which were made static
* changes on returned locales which do no longer degrade to other types
In 75% of the cases you will not have to change anything. But you should properly check this.
With the next release 1.8 we will change the compatibility mode to false per default, and with 1.9 we will delete it completly so only the new API behaviour is active.
Greetings
Thomas Weidner
I18N Team Leader, Zend Framework
Zend Framework Advisory Board Member
Zend Certified Engineer for Zend Framework
Add comment
Fill out the form below to add your own comments

Tuesday, November 25, 2008 - 21:02:29
From migration doc:
> The meaning of the getDefault() method has been change due to the fact that we integrated a framework locale which can be set with setDefault().
Isn’t the framework locale whatever is set in Zend_Registry::get(’Zend_Locale’)?
What’s the difference between these?
Wednesday, November 26, 2008 - 14:31:47
When you want the locale to be detected automatically ZF tries the following sources:
* Users browser -> HTTP_ACCEPT_LANGUAGE
* Environment -> setlocale
* Default locale -> setDefault
Sometimes it’s not possible to detect a locale, and as the default, or also called framework locale, defaults to ‘en’, ZF is always able to detect a locale even if PHP does not.
The application wide locale you mentioned with the registry call is not integrated in Zend_Locale. It’s more a sort of handling feature which is integrated in all other classes which make use of Zend_Locale.
Friday, February 6, 2009 - 05:30:01
thanks for this along with the explanation
Tuesday, April 17, 2012 - 02:49:01
I agree with you, but dont be too rude !
whatever, great site !