Migrating from previous versionsThe API of Zend_Locale has changed from time to time. If you started to use Zend_Locale and its subcomponents in earlier versions follow the guidelines below to migrate your scripts to use the new API. Migrating from 1.8 to 1.9 or newerDepreciated methodsSome specialized translation methods have been depreciated because they duplicate existing behaviour. Note that the old methods will still work, but a user notice is triggered which describes the new call. The methods will be erased with 2.0. See the following list for old and new method call.
Migrating from 1.7 to 1.8 or newerDefault cachingAs with Zend Framework 1.8 a default caching was added. The reason behind this change was, that most users had performance problems but did not add caching at all. As the I18n core is a bottleneck when no caching is used we decided to add a default caching when no cache has been set to Zend_Locale. Sometimes it is still wanted to prevent caching at all even if this decreases performance. To do so you can simply disable caching by using the disableCache() method. Example #1 Disabling default caching
Migrating from 1.6 to 1.7 or newerChanges when using isLocale()According to the coding standards isLocale() had to be changed to return a boolean. In previous releases a string was returned on success. For release 1.7 a compatibility mode has been added which allows to use the old behaviour of a returned string, but it triggers a user warning to mention you to change to the new behaviour. The rerouting which the old behaviour of isLocale() could have done is no longer neccessary as all I18N will now process a rerouting themself. To migrate your scripts to the new API, simply use the method as shown below. Example #2 How to change isLocale() from 1.6 to 1.7
Note that you can use the second parameter to see if the locale is correct without processing a rerouting.
Changes when using getDefault()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(). It does no longer return the locale chain but only the set framework locale. To migrate your scripts to the new API, simply use the method as shown below. Example #3 How to change getDefault() from 1.6 to 1.7
Note that the second parameter of the old getDefault() implementation is not available anymore, but the returned values are the same.
|