Sunday
2
January
2011

Zend_Locale 2.0

Hy fellows,

first I want to wish you all a good start into this new decade.
Then I wanted to inform you about some news for Zend Framework.

Within the last days I began a complete rework of the I18n core for ZF.
The first class which will be reworked is Zend_Locale as it’s the base class for I18n within ZF.

The following changes will be done for Zend Locale 2.0:

CLDR update to 1.9
This integrates the most actual locale database within ZF

Usage of a fallback locale
This locale can be set and used as fallback when the wished locale is not supported

Usage of a fixed locale
This locale can be set and will be used regardless of any other locale which the accessing user wants
This removes the workaround from Zend_Application

Add locale providers as base
This allows to use other locale providers than CLDR
This will remove Zend_Locale_Format and integrate it into the used provider

Rework CLDR to be a provider

Add INTL as new provider
This allows to use INTL when available alone or in combination with CLDR because the INTL extension does not provide all informations like CLDR

Add a way to upgrade a locale
This would allow to provide informations for language locales when no region was given (f.e. when a user gives ‘en’ and wants to have informations from a region (f.e. currency))

Add script support
This allows to use locales which provide several scripts within the same language like Azerbaijani, English or Hausa.

That’s the actual plan for Zend_Locale 2.0 and will be the base for all other reworks.
Please note that all spoken will be done within Zend Framework 2.0 and not be migrated to 1.x.

Greetings
Thomas Weidner
I18N Team Leader, Zend Framework

Zend Framework Advisory Board Member
Zend Certified Engineer for Zend Framework

Back to top
Saturday
3
April
2010

Using countries for localization

Hy interested ones,

I did not find a correct heading for what I want to describe you today.
But there is a new feature which has been implemented by me so let’s see some details:

Most of you are already using Zend_Locale. Give a language and get a locale in return.
You used this for translation, currency, date or other purposes.

Now the idea for this new feature is simple… why should a user not be able to give a country instead of a language to get a locale in return. For example “austria”… when I give “AT” then I could expect that the locale “de_AT” is being used.

And exactly this feature is available as with ZF 1.10.4 or ZF 2.0.

Of course there are much other usecases where this feature could be used.
For example, when your user selects a flag which represents his country. Then you could use only the region/country to get a locale with language in return.

$locale = new Zend_Locale('US');
// returns "en_US"

Or think of currencies. You could just give the country and get the currency for this country.

$currency = new Zend_Currency(array('locale' => 'AT'));
// uses "EUR" which is the currency for the locale "de_AT"

Generally you can use this feature everywhere within the whole framework where you used only languages or locales before.

But of course there is one thing to note:
You have to uppercase countries when you want to use them. The reason is that there are countries which are equal to languages. For example “om”… you could mean the country Oman and expect “ar_OM” as locale, or you could mean the language “Oromo” and expect “or_KE” as locale.

When you find this feature useful, feel free to use it yourself. :-)

Greetings
Thomas Weidner
I18N Team Leader, Zend Framework

Zend Framework Advisory Board Member
Zend Certified Engineer for Zend Framework

Back to top
Wednesday
20
May
2009

New CLDR implemented

Today I updated the locale database to the latest release (CLDR 1.7) which is available since 2 weeks by unicode. It provides several corrections for existing locale informations.

Corrected currency signs, additional locales, additional timezone data and much more. This update changes about 5MB of data and is only provided within trunk. It will be available to ZF with the next minor release 1.9.

Additional new informations are provided by CLDR like
* postalcodes
* phonecodes
* locale upgrading
and several more.

This new informations will be integrated within ZF soon.
See http://framework.zend.com/issues/browse/ZF-6681 for informations about new features to be integrated.

Please note, that like in past Zend (and me) is not allowed to provide changed CLDR files. When you find a error you have to possibilities.

* Anyone who finds an error can keep it private
* Or feel free to write a issue to unicode (unicode.org/cldr) about incorrect informations

I hope you find it usefull

Greetings
Thomas Weidner
I18N Team Leader, Zend Framework

Zend Framework Advisory Board Member
Zend Certified Engineer for Zend Framework

Back to top