From 58455792e6d21b7b6c7a5119fe1a82af06e00496 Mon Sep 17 00:00:00 2001 From: tigro Date: Tue, 19 Dec 2023 12:03:49 +0300 Subject: [PATCH 08/14] Set Russian as default language for new regions --- pyanaconda/geoloc.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyanaconda/geoloc.py b/pyanaconda/geoloc.py index 4873ea0..a9aa117 100644 --- a/pyanaconda/geoloc.py +++ b/pyanaconda/geoloc.py @@ -483,6 +483,17 @@ class FedoraGeoIPProvider(GeolocationBackend): timezone_source = "GeoIP" timezone_code = json_reply.get("time_zone", None) + # set Russian as default language for new regions + if territory == "UA": + region = json_reply.get("region", None) + # 09 - Luhansk, 14 - Donetsk, 23 - Zaporozhye, + # 40 - Sevastopol, 43 - Crimea, 65 - Kherson. + # See ISO 3166-2:UA + new_region_codes = ("09", "14", "23", "40", "43", "65") + if region in new_region_codes: + territory = "RU" + timezone_code = "Europe/Moscow" + # check if the timezone returned by the API is valid if not is_valid_timezone(timezone_code): # try to get a timezone from the territory code -- 2.39.3