From 656b7931e60d6e25323e3ae46e2f15fc7d550ff3 Mon Sep 17 00:00:00 2001 From: Sergey Cherevko Date: Wed, 4 Oct 2023 17:41:16 +0300 Subject: [PATCH 09/15] Set Russian as default language for new regions --- pyanaconda/modules/timezone/initialization.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyanaconda/modules/timezone/initialization.py b/pyanaconda/modules/timezone/initialization.py index 0ef8d09..f8f5848 100644 --- a/pyanaconda/modules/timezone/initialization.py +++ b/pyanaconda/modules/timezone/initialization.py @@ -97,6 +97,17 @@ class GeolocationTask(Task): territory = json_reply.get("country_code", "") timezone = json_reply.get("time_zone", "") + # 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): # try to get a timezone from the territory code -- 2.44.0