locale-code icon indicating copy to clipboard operation
locale-code copied to clipboard

Kosovo (XK), Netherlands Antilles (AN) LocaleCode.getCountryName() doesn't work right

Open utschenik opened this issue 5 years ago • 5 comments

Hello,

I have a custom country list, that i am looping through and trying to render the country list with it's orignal country names. For 202 countries it works really great, but with 2 countries it doesn't work.

I am using the method LocaleCode.getCountryName() to get the original country names from Kosovo and Netherlands Antiles, but I get nothing returned.

Example:

LocaleCode.getCountryName('en-AN') LocaleCode.getCountryName('en-XK')

Thanks for your help!

utschenik avatar Oct 19 '20 10:10 utschenik

Hi @utschenik , this module use iso-3166-1-alpha-2 under the hood to handle country names. I checked here https://github.com/georgzoeller/iso-3166-1-alpha-2/blob/master/index.js, and found out AN and XK are not included in it's country list. And they are not in Wiki ISO_3166-1_alpha-2 country list as well.

I would suggest you to raise an issue on iso-3166-1-alpha-2 project. Once they update it, I would like to release a new version accordingly.

meikidd avatar Oct 19 '20 11:10 meikidd

i raised a new issue for both countries (https://github.com/georgzoeller/iso-3166-1-alpha-2/issues/5), i would let you know in this issue if they adjusted their country list or not.

utschenik avatar Oct 19 '20 11:10 utschenik

Hey merge is done with my changes (https://github.com/georgzoeller/iso-3166-1-alpha-2/pull/6)

utschenik avatar Oct 19 '20 14:10 utschenik

That's great. But still need them to publish a new version to npm, so that I can upgrade my dependency version in package.json

meikidd avatar Oct 19 '20 15:10 meikidd