-
-
Notifications
You must be signed in to change notification settings - Fork 662
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
Missing Kosovo #793
Comments
Hi @melder, The issue with Kosovo is that there is no ISO3166 code assigned at this time. Code The workaround we've recommended is to load custom data, something along these lines, with the attributes that you require: ISO3166::Data.register(
alpha2: "XK",
alpha3: "XKX",
name: "Kosovo",
currency: "EUR",
translations: {
"en" => "Kosovo",
},
) |
Ok will do. Any other disputed territories that ISO3166 does not recognize but have unofficial country codes? I couldn't find anything while googling. I'm genuinely surprised about Kosovo as it has been independent for 15 years already. Even Palestine, who are not a sovereign entity are recognized on ISO3166? Very strange. |
FYI: When adding the As a workaround i monkeypatched the output of country_select gem like this:
|
@maxigs I'll look into it, thanks for the report. @melder As far as I'm aware, Kosovo is the only country in this situation. There are other countries with limited recognition (https://en.wikipedia.org/wiki/List_of_states_with_limited_recognition) that have ISO3166 codes, such as Palestine and Western Sahara, and there are those that don't have ISO3166 codes, but are not widely recognised as independent countries, so there hasn't been an issue. |
Did something happened here ? |
As I mentioned in my initial reply to this issue, Kosovo does not have an ISO3166 code assigned to it. Until that happens, you can manually add it as a custom country. I've left this issue open because it has been raised several times in the past, and it's more visible as an open issue. |
@pmor thank you for your work and for leaving this issue open! Here's the nearly complete data for ISO3166::Data.register(
alpha2: "XK",
alpha3: "XKX",
continent: "Europe",
country_code: "383",
currency_code: "EUR",
distance_unit: "KM",
gec: "KV",
geo: {
latitude: 42.5833,
longitude: 21.0001,
max_latitude: 43.139,
max_longitude: 21.835,
min_latitude: 41.877,
min_longitude: 19.949,
bounds: {
northeast: {
lat: 41.877,
lng: 19.949,
},
southwest: {
lat: 43.139,
lng: 21.835,
}
}
},
international_prefix: "00",
ioc: "KOS",
iso_long_name: "Republic of Kosovo",
iso_short_name: "Kosovo",
languages_official: ["sq", "sr"],
languages_spoken: ["sq", "sr"],
nationality: "Kosovar",
postal_code: true,
postal_code_format: "\\d{5}",
region: "Europe",
start_of_week: "monday",
subregion: "Southern Europe",
unofficial_names: ["Kosovo", "Kosova", "Косово"],
world_region: "EMEA",
translations: {
"en" => "Kosovo",
},
) |
Not sure why you are missing Kosovo:
From
https://countrycode.org/kosovo
Kosovo | 383 | XK / XKX | 1,800,000 | 10,887 | 7.15 Billion
I use this library to rate limit requests from countries and essentially got DDOSed by Kosovo since it was missing. Had to manually block Kosovo IP range.
Thanks
The text was updated successfully, but these errors were encountered: