Skip to content

Commit

Permalink
Merge pull request #1555 from alephdata/pudo/country-cleanup
Browse files Browse the repository at this point in the history
Clean up Sark country code, add UN, remove some non-countries
  • Loading branch information
pudo authored Oct 5, 2024
2 parents 8c3aecf + f90c7b2 commit 93c5170
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 8 additions & 1 deletion followthemoney/types/country.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def _locale_names(self, locale: Locale) -> EnumValues:
names = {
"zz": gettext("Global"),
"eu": gettext("European Union"),
"un": gettext("United Nations"),
"zr": gettext("Zaire"),
# Overwrite "Czechia" label:
"cz": gettext("Czech Republic"),
Expand All @@ -46,7 +47,7 @@ def _locale_names(self, locale: Locale) -> EnumValues:
"cy-trnc": gettext("Northern Cyprus"),
"az-nk": gettext("Nagorno-Karabakh"),
"cn-xz": gettext("Tibet"),
"gg-srk": gettext("Sark"),
"cq": gettext("Sark"),
"gb-wls": gettext("Wales"),
"gb-sct": gettext("Scotland"),
"gb-nir": gettext("Northern Ireland"),
Expand All @@ -61,6 +62,12 @@ def _locale_names(self, locale: Locale) -> EnumValues:
int(code)
except ValueError:
names[code] = label
# Remove some ISO-3611 codes that are not countries:
names.pop("xa", None)
names.pop("xb", None)
names.pop("qo", None)
names.pop("ea", None)
names.pop("ez", None)
return names

def clean_text(
Expand Down
6 changes: 0 additions & 6 deletions js/src/defaultModel.json
Original file line number Diff line number Diff line change
Expand Up @@ -7154,7 +7154,6 @@
"dm": "Dominica",
"do": "Dominican Republic",
"dz": "Algeria",
"ea": "Ceuta & Melilla",
"ec": "Ecuador",
"ee": "Estonia",
"eg": "Egypt",
Expand All @@ -7163,7 +7162,6 @@
"es": "Spain",
"et": "Ethiopia",
"eu": "European Union",
"ez": "Eurozone",
"fi": "Finland",
"fj": "Fiji",
"fk": "Falkland Islands",
Expand All @@ -7180,7 +7178,6 @@
"ge-ab": "Abkhazia (Occupied Georgia)",
"gf": "French Guiana",
"gg": "Guernsey",
"gg-srk": "Sark",
"gh": "Ghana",
"gi": "Gibraltar",
"gl": "Greenland",
Expand Down Expand Up @@ -7290,7 +7287,6 @@
"pw": "Palau",
"py": "Paraguay",
"qa": "Qatar",
"qo": "Outlying Oceania",
"re": "Réunion",
"ro": "Romania",
"rs": "Serbia",
Expand Down Expand Up @@ -7356,8 +7352,6 @@
"wf": "Wallis & Futuna",
"ws": "Samoa",
"x-so": "South Ossetia (Occupied Georgia)",
"xa": "Pseudo-Accents",
"xb": "Pseudo-Bidi",
"xk": "Kosovo",
"ye": "Yemen",
"yt": "Mayotte",
Expand Down

0 comments on commit 93c5170

Please sign in to comment.