Giter VIP home page Giter VIP logo

Comments (5)

alcohol avatar alcohol commented on August 23, 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".

from iso3166.

chris114782 avatar chris114782 commented on August 23, 2024

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.

from iso3166.

alcohol avatar alcohol commented on August 23, 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));

from iso3166.

alcohol avatar alcohol commented on August 23, 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).

from iso3166.

chris114782 avatar chris114782 commented on August 23, 2024

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.

from iso3166.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.