From f264ec99bcbba7d9bdaee3b7e8c1060f307a12d0 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 19 Nov 2024 11:10:42 +0100 Subject: [PATCH] i18n: Fallback to english in retrieve_country_name --- eduvpn/i18n.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/eduvpn/i18n.py b/eduvpn/i18n.py index e70dcff1..0a7a5c1c 100644 --- a/eduvpn/i18n.py +++ b/eduvpn/i18n.py @@ -73,16 +73,9 @@ def extract_translation(d: Union[str, Dict[str, str]]): def retrieve_country_name(country_code: str) -> str: country_map = _read_country_map() - loc = locale.getlocale() - if loc[0] is None: - prefix = "en" - else: - prefix = loc[0][:2] - if country_code in country_map: - code = country_map[country_code] - if prefix in code: - return code[prefix] - return country_code + if country_code not in country_map: + return country_code + return extract_translation(country_map[country_code]) def _read_country_map() -> dict: