iso3166 icon indicating copy to clipboard operation
iso3166 copied to clipboard

Use of the definite article (the) in country names

Open chris114782 opened this issue 1 year ago • 5 comments

Hi,

In ISO 3166-1 many countries in the official standard use the definite article (the) in their name.

An example is Korea (the Republic of) (alpha2 code KR)

The ISO standard list shows it as "Korea (the Republic of)": https://www.iso.org/obp/ui/#iso:code:3166:KR

This package shows it as "Korea (Republic of):" https://github.com/thephpleague/iso3166/blob/main/src/ISO3166.php#L1278

Does the standard allow for the definite article to be optional or is this an error / omssion?

chris114782 avatar Feb 05 '24 10:02 chris114782

:shrug:

I am not sure to be honest. The short name (uppercase) often omits "the". But since this package contains the lowercase short name, maybe we should not omit it? But what is the added value of adding it? Is it going to help users identify the correct country? I am usually a fan of "less is more".

alcohol avatar Feb 05 '24 14:02 alcohol

In our use case we are providing data from our app (which uses the alpha-3 code internally) to a third party which is expecting the name instead. The third party are failing validation because we aren't using the name as it appears in the standard as far as they are concerned.

I personally agree with you on the less is more (and dislike the idea of validating based on the name), but I guess the point of a standard is that everyone implementing that standard should use the same data, and the name as it appears in the library doesn't match any of the fields for the same country in the ISO3166-1 list.

chris114782 avatar Feb 05 '24 15:02 chris114782

That seems like a very weird choice, also given the fact that the name of a country can be very different from a language perspective. This library happens to present all data in English (can't even tell if it qualifies as en-US or en-GB though) and does not offer translations, but generally it is much saner to use the code rather than the name.

As a quick "fix", you could instantiate the library with a dataset that satisfies the third party criteria, e.g.:

$data = array_column((new ISO3166())->all(), null, 'alpha2');
$data['KR']['name'] = 'Korea (the Republic of)';

$fixed = new ISO3166(array_values($data));

alcohol avatar Feb 05 '24 16:02 alcohol

As a reference, for the name, I used the table provided at https://en.wikipedia.org/wiki/ISO_3166-1 since this library is focused on ISO3166-1 (though the name is misleading I will admit).

alcohol avatar Feb 05 '24 16:02 alcohol

Thank you for your time, especially pointing out the distinction of ISO 3166-1 vs 3166-2, that's a point I hadn't considered.

chris114782 avatar Feb 06 '24 09:02 chris114782