[firstboot 2/2] Set the LANG variable if running our own X frontend (#599296)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The init script sources the /etc/profile.d/lang.sh file,
which overwrites LANG variable with en_US for some
languages not supported in console.
If we are not running in text mode, we want to have
the LANG variable set as is in /etc/sysconfig/i18n.
---
 firstboot/xfrontend.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/firstboot/xfrontend.py b/firstboot/xfrontend.py
index 40abc21..805f09f 100644
--- a/firstboot/xfrontend.py
+++ b/firstboot/xfrontend.py
@@ -18,7 +18,7 @@
 # with the express permission of Red Hat, Inc. 
 #
 import logging
-import os, string, subprocess, sys, signal
+import os, string, subprocess, sys, signal, shlex
 
 ##
 ## I18N
@@ -60,6 +60,15 @@ class XFrontEnd:
     def start(self):
         os.environ["DISPLAY"] = ":9"
 
+        # set up the lang variable according to what's set in i18n
+        with open("/etc/sysconfig/i18n", "r") as f:
+            data = f.read()
+        for line in shlex.split(data):
+            key, value = line.split("=")
+            if key == "LANG":
+                os.environ[key] = value
+                break
+
         try:
             args = [":9", "-ac", "-nolisten", "tcp", "vt6", "-br"]
             noOutput = os.open("/dev/null", os.O_RDWR)
-- 
1.6.6.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux