Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of the definite article (the) in country names #100

Open
chris114782 opened this issue Feb 5, 2024 · 5 comments
Open

Use of the definite article (the) in country names #100

chris114782 opened this issue Feb 5, 2024 · 5 comments

Comments

@chris114782
Copy link

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?

@alcohol
Copy link
Owner

alcohol commented Feb 5, 2024

🤷

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".

@chris114782
Copy link
Author

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.

@alcohol
Copy link
Owner

alcohol commented Feb 5, 2024

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
Copy link
Owner

alcohol commented Feb 5, 2024

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).

@chris114782
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants