You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.5 KiB
35 lines
1.5 KiB
1 week ago
|
From da01c87c5fc2c2d14fc05b0bccbe47f2e8f6f142 Mon Sep 17 00:00:00 2001
|
||
|
From: Sergey Cherevko <s.cherevko@msvsphere-os.ru>
|
||
|
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 3b97a4d..ebe5e7c 100644
|
||
|
--- a/pyanaconda/modules/timezone/initialization.py
|
||
|
+++ b/pyanaconda/modules/timezone/initialization.py
|
||
|
@@ -101,6 +101,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.43.5
|
||
|
|