From c9dcb20e501e2f15af39ea506b2b34e28f11a140 Mon Sep 17 00:00:00 2001 From: MCleinman <9295855+mcleinman@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:44:07 -0800 Subject: [PATCH] VPN-6649: fix translations for cities with special characters (#10029) * VPN-6649 fix translations for cities with special characters * simply with a regex --- scripts/ci/update_server_names.py | 3 +++ src/translations/extras/extras.xliff | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/ci/update_server_names.py b/scripts/ci/update_server_names.py index 15b1e45543..0f92ec384e 100755 --- a/scripts/ci/update_server_names.py +++ b/scripts/ci/update_server_names.py @@ -62,6 +62,9 @@ def fetch_server_list(): for city in cities: # Remove state suffix, capitalize each work, remove spaces. id = city.split(",")[0].strip().title().replace(" ", "") + # Remove special characters like the `ö` in `Malmö` + id = re.sub(r'[^a-zA-Z]+', '', id) + # Add it to the map string_map[id] = city ### diff --git a/src/translations/extras/extras.xliff b/src/translations/extras/extras.xliff index cc1855407f..42979fe94b 100644 --- a/src/translations/extras/extras.xliff +++ b/src/translations/extras/extras.xliff @@ -384,9 +384,6 @@ Gothenburg - - Malmö - Stockholm @@ -531,6 +528,9 @@ Nicosia + + Malmö +