Skip to content

Commit

Permalink
simply with a regex
Browse files Browse the repository at this point in the history
  • Loading branch information
mcleinman committed Nov 13, 2024
1 parent cc3040d commit 106f33d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions scripts/ci/update_server_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,11 @@ def fetch_server_list():
string_map = countries
for city in cities:
# Remove state suffix, capitalize each work, remove spaces.
baseId = city.split(",")[0].strip().title().replace(" ", "")
id = city.split(",")[0].strip().title().replace(" ", "")
# Remove special characters like the `ö` in `Malmö`
allowedIdChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
simpleId = ""
for char in baseId:
if char in allowedIdChars:
simpleId = simpleId + char
id = re.sub('[^a-zA-Z]+', '', id)
# Add it to the map
string_map[simpleId] = city
string_map[id] = city

###
# 2. Fetch the list of servers in extras.xliff
Expand Down

0 comments on commit 106f33d

Please sign in to comment.