[nanny: 4/11] Save LANG env-var when start nanny-systray



commit 1972d00c11a2b7eaa1c1162e78e3ba6164c8b523
Author: Roberto Majadas <roberto majadas openshine com>
Date:   Thu Apr 1 04:51:25 2010 +0200

    Save LANG env-var when start nanny-systray

 client/gnome/systray/nanny-systray |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/client/gnome/systray/nanny-systray b/client/gnome/systray/nanny-systray
index e8c2003..f498cd2 100644
--- a/client/gnome/systray/nanny-systray
+++ b/client/gnome/systray/nanny-systray
@@ -17,6 +17,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 # USA
 
+import os
 import gtk
 import gettext
 import __builtin__
@@ -30,5 +31,18 @@ import nanny.client.gnome.systray
 
 __builtin__._ = gettext.gettext
 
+try:
+    if os.environ.has_key("LANG") :
+        if not os.path.exists(os.path.join(os.environ["HOME"], ".config", "nanny")):
+            os.system("mkdir -p %s" % os.path.join(os.environ["HOME"], ".config", "nanny"))
+
+        os.system("echo 'LANG=%s' > %s" % (os.environ["LANG"], 
+                                          os.path.join(os.environ["HOME"], ".config", "nanny", "lang")
+                                          )
+                  )
+except:
+    pass
+        
+
 nanny_systray = nanny.client.gnome.systray.SystrayNanny()
 gtk.main()



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