-
Notifications
You must be signed in to change notification settings - Fork 101
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
List of ISO country codes #874
Comments
Hi, @jfbrennan! Some initial feedback on your proposal:
Probably you can't simply ship to all countries. You probably want to get the list of supported regions from your fulfillment partner.
Seems like this would want to be paired with an additional phone number formatting API.
The list of countries should probably come from your payment partner, yes? |
I understand i18n stuff is tough and standards aren't always 100% reliable, but there is a standard and it should be followed: https://www.iso.org/iso-3166-country-codes.html. All questions about what is included are answered by the standard - the list you get from JavaScript is the list that ISO 3166 defines. So maybe
Yeah, browsers differ. Hasn't stopped the web in the past, shouldn't be a reason to not progress going forward. Define the spec, the rest is left up to implementers 🤞
Let's avoid nitpicking the UX examples - they're just examples. |
I'm looking to avoid maintaining a list of country codes in my app. I would expect JavaScript runtimes to provide this data.
This is precisely what I wish Intl would add to the current supportedValuesOf method:
Many
Intl
APIs apparently have mappings for country codes, so perhaps this internal list of codes can be given a public interface (and my apologies if I didn't google hard enough...I spent a lot of time searching around and reading MDN and SO and the tc39 backlogs and didn't find answers).Why this is needful:
An example:
The text was updated successfully, but these errors were encountered: