[PATCH] Check whether keyboard translations are stale (#972236)

David Shea dshea at redhat.com
Thu Sep 12 15:28:15 UTC 2013


---
 pyanaconda/keyboard.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index 5b1643c..5f423c6 100644
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -371,11 +371,17 @@ class XklWrapper(object):
     """
 
     _instance = None
+    _instance_lang = None
 
     @staticmethod
     def get_instance():
+        # If the language has changed, we need to grab new strings
+        if os.environ["LANG"] != XklWrapper._instance_lang:
+            XklWrapper._instance = None
+
         if not XklWrapper._instance:
             XklWrapper._instance = XklWrapper()
+            XklWrapper._instance_lang = os.environ["LANG"]
 
         return XklWrapper._instance
 
-- 
1.8.3.1



More information about the anaconda-patches mailing list