Country name improvements, remove disputed areas

This commit is contained in:
Mikko Ahlroth 2021-01-30 13:05:19 +02:00
parent 53d576bda7
commit a4606fc59b
2 changed files with 9 additions and 7 deletions

View file

@ -65,7 +65,7 @@ defmodule FlagQuiz.Flags do
"Kongo-Kinshasa",
"Kinshasan Kongo"
]},
{"CF", ["Central African Republic", "Keski-Afrikka"]},
{"CF", ["Central African Republic", "Central Africa", "Keski-Afrikka"]},
{"CG", ["Congo", "Congo Rebublic", "Kongo", "Kongon tasavalta"]},
{"CH", ["Switzerland", "Sveitsi"]},
{"CI", ["Côte d'Ivoire", "Ivory Coast", "Norsunluurannikko"]},
@ -90,7 +90,7 @@ defmodule FlagQuiz.Flags do
{"EC", ["Ecuador"]},
{"EE", ["Estonia", "Viro"]},
{"EG", ["Egypt", "Egypti"]},
{"EH", ["Western Sahara", "Länsi-Sahara"]},
# {"EH", ["Western Sahara", "Länsi-Sahara"]},
{"ER", ["Eritrea"]},
{"ES", ["Spain", "Espanja"]},
{"ET", ["Ethiopia", "Etiopia"]},
@ -150,7 +150,7 @@ defmodule FlagQuiz.Flags do
"Pohjois-Korea"
]},
{"KR", ["Korea, Republic of", "Korea", "Republic of Korea", "South Korea", "Etelä-Korea"]},
{"KW", ["Kuwait", "Kuwait"]},
{"KW", ["Kuwait"]},
# {"KY", ["Cayman Islands"]},
{"KZ", ["Kazakhstan", "Kazakstan"]},
{"LA", ["Lao People's Democratic Republic", "Laos"]},
@ -163,7 +163,7 @@ defmodule FlagQuiz.Flags do
{"LT", ["Lithuania", "Liettua"]},
{"LU", ["Luxembourg", "Luxemburg"]},
{"LV", ["Latvia"]},
{"LY", ["Libya", "Libya"]},
{"LY", ["Libya"]},
{"MA", ["Morocco", "Marokko"]},
{"MC", ["Monaco"]},
{"MD", ["Moldova, Republic of", "Moldova"]},
@ -211,7 +211,7 @@ defmodule FlagQuiz.Flags do
# {"PM", ["Saint Pierre and Miquelon"]},
# {"PN", ["Pitcairn"]},
# {"PR", ["Puerto Rico"]},
{"PS", ["Palestine", "Palestiina", "Palestiinalaisalueet"]},
# {"PS", ["Palestine", "Palestiina", "Palestiinalaisalueet"]},
{"PT", ["Portugal", "Portugali"]},
{"PW", ["Palau"]},
{"PY", ["Paraguay"]},
@ -256,7 +256,7 @@ defmodule FlagQuiz.Flags do
{"TR", ["Turkey", "Turkki"]},
{"TT", ["Trinidad and Tobago", "Trinidad ja Tobaco"]},
{"TV", ["Tuvalu"]},
{"TW", ["Taiwan"]},
{"TW", ["Taiwan", "Republic of China"]},
{"TZ", ["Tanzania, United Republic of", "Tanzania", "Tansania"]},
{"UA", ["Ukraine", "Ukraina"]},
{"UG", ["Uganda"]},

View file

@ -88,13 +88,15 @@ defmodule FlagQuizWeb.PageLive do
name
|> String.downcase()
|> String.normalize(:nfc)
|> String.replace(" and the ", " & ")
|> String.replace("the ", "")
|> String.replace(" and ", " & ")
|> String.replace(" ja ", " & ")
|> String.replace("saint ", "st ")
|> String.replace(["ä", "ã", "é", "í", "ö", "ô", "š", "ž", "ç"], &replace_special/1)
|> String.replace(~R/\s*/, "")
|> String.replace("-", "")
|> String.replace("'", "")
|> String.replace(",", "")
end
defp replace_special(char)