Hy Ian,

 $locale = new Zend_Locale('en_GB');
 $country_array = $locale->getRegionList();

This provides some functionality
However within the initial array there is continental data
[001] => World
[002] => Africa
[003] => North America
[005] => South America
[009] => Oceania

It would be nice to delimit on countries or continents etc. And also to
state whether the array should be ISO 2 char or 3 char, and maybe some flags
to sort this array - either by country code or country.

Related to ISO:

The ISO Standard defines for regions 2 chars and 3 digit abbreviations for all region strings.
But the definition is quite simple...
3 digits represent regions which consist of several countries.
2 chars represent regions where the region is identic with only one country.

So if you are only in need of the countries you will have to strip all 3 digit arraykeys.

As you will get an array returned the sorting is no problem.
Just sort your array the way you want.
I think it should be no problem to sort your array by key or value... it would be no simplification to have an additionaly parameter for sorting as there already exist several standard php functions for array handling.

Anyway very new to Zend if I am missing something then I apologise - but
just trying to get my head around this method, is this work in progress?

Zend_Locale is finished... actualy there are no opened issues or new feature requests.

Btw: You will not have to translate your country with gettext... Zend_Locale already supports all information in all languages natively. And you may want to use Zend_Translate instead of php's gettext... it does not need the extension installed, is threadsave and reads directly from the compressed mo file.

Greetings
Thomas
I18N Team Leader

Reply via email to