My question though pointed at the fact that I have these three digit
elements mixed in within the 2 char country codes, with no discernable way
to sort what countries belong to what 3 digit group.

To be clear:
The functions name is getRegionList()

A region is not a country... a region can also include several countries.
The original term is "territory".

So all returned values are regions... countries are only the 2 lettered ones.

Also threre is not always a relation between Region and Country.
f.e. Czechoslovakia - region 200 is wether a country nor a region which includes several countries.
It is standalone.

And the 3 digit codes are also no continents.
Or do you believe that "Caribbean" (029) is a continent ??? :-))

Wouldn't it be better to create a separate method that returned these like
getContinentList()

It returned:

[002] => Africa
[003] => North America
[005] => South America
[009] => Oceania
[00?] => Europe

Nice feature but not possible...
Is Northern America or Eastern Asia a continent ??

Also several 3 digit territories also contain other 3 digit territories...
f.e. 001 contains 150 (world -> europe)
150 contains 151 (europe -> eastern europe)
151 contains PL (eastern europe -> poland)

There is no good way to seperate between continents and non continents.
Also 2 digit regions can contain other regions...
f.e. QO contains BV

And then we marked the relation in the country array as below:
And also that I wanted the option to have the countries use there ISO 3 char
elements i.e.

United Kingdom GB GBR

The 3 char in my experience is always better to use, also maybe the dial
code is a nice option.

So array may be [GB] => array(00?(Europe), United Kingdom, GBR, 44)

We can only work with informations which we have.
We only have the ISO abbreviation codes for all regions, this means
3 digit and 2 char.

We do not have the informations for country dialing code (44) or 3 letter abbreviations (GBR) nor
2 letter non standard abbreviations (UK).

It would be no good way to have multidimensional arrays.
For simplification and easy handling the returned values are always plain arrays.

Again very new so would like to here from people who can comment on these
ideas, or indeed use this package to create simple hier selects for
continent, country, town etc selections.

Territory select :

$data = $locale->getRegionList();

foreach ($data as $key -> $territory) {
   if (is_int($key)) {
       print "\nMultiple:$territory";
   }
}

foreach ($data as $key -> $territory) {
   if (!is_int($key)) {
       print "\nSingle:$territory";
   }
}

To clearify things:
This data is avaiable through the localization library which was included within the framework.

Therefor we can f.e. display the name of countries in every language. But the negative thing is that we can only display and return data which is avaiable through the library.

For now the zend framework is the only one which gives the possibility to have such data simply avaiable within one single function.

Btw:
This discussion is very close to I18N problems / components.
You should reply to fw-i18n instead of fw-general for all i18n components to keep fw-general clean for non specific problems :)

Greetings
Thomas
I18N Team Leader

Reply via email to