DistroBaker 74d5a6
From 00bd48ce9a7ac00e6b47610a9477b43016acd080 Mon Sep 17 00:00:00 2001
DistroBaker 74d5a6
From: Vendula Poncova <vponcova@redhat.com>
DistroBaker 74d5a6
Date: Mon, 1 Mar 2021 11:54:34 +0100
DistroBaker 74d5a6
Subject: [PATCH] Choose the best locale more carefully (#1933384)
DistroBaker 74d5a6
DistroBaker 74d5a6
Use the default locale if there are no locales to choose from.
DistroBaker 74d5a6
DistroBaker 74d5a6
Resolves: rhbz#1933384
DistroBaker 74d5a6
---
DistroBaker 74d5a6
 pyanaconda/ui/gui/spokes/welcome.py | 3 ++-
DistroBaker 74d5a6
 1 file changed, 2 insertions(+), 1 deletion(-)
DistroBaker 74d5a6
DistroBaker 74d5a6
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
DistroBaker 74d5a6
index fb49188c1..0e17d8106 100644
DistroBaker 74d5a6
--- a/pyanaconda/ui/gui/spokes/welcome.py
DistroBaker 74d5a6
+++ b/pyanaconda/ui/gui/spokes/welcome.py
DistroBaker 74d5a6
@@ -228,7 +228,8 @@ class WelcomeLanguageSpoke(StandaloneSpoke, LangLocaleHandler):
DistroBaker 74d5a6
         store.set(commonLangsItr, 0, "", 1, "", 2, "", 3, True)
DistroBaker 74d5a6
 
DistroBaker 74d5a6
         # setup the "best" locale
DistroBaker 74d5a6
-        locale = localization.setup_locale(locales[0], self._l12_module)
DistroBaker 74d5a6
+        best_locale = locales[0] if locales else DEFAULT_LANG
DistroBaker 74d5a6
+        locale = localization.setup_locale(best_locale, self._l12_module)
DistroBaker 74d5a6
         self._set_lang(locale)
DistroBaker 74d5a6
         self._select_locale(self._l12_module.Language)
DistroBaker 74d5a6
 
DistroBaker 74d5a6
-- 
DistroBaker 74d5a6
2.26.2
DistroBaker 74d5a6