TakahikoKawasaki / nv-i18n

Package to support internationalization, containing ISO 3166-1 country code enum, ISO 639-1 language code enum, etc.
Apache License 2.0
389 stars 115 forks source link

getByCode for United Kingdom #93

Open freyjajokulsd opened 1 year ago

freyjajokulsd commented 1 year ago

Currently the United Kingdom is one of the countries that does not have an alpha3 See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Exceptional_reservations'

It could be useful to have the getByCode method return the Great Britain country code for UK so that is has an alpha3 and so that the following statement is true:

United Kingdom is officially assigned the alpha-2 code GB

For an example CountryCode.getByCode("UK") would return CountryCode.GB and therefore .alpha3 will not throw a NPE like it does for CountryCode.UK