add ability to remove list and config from a wizard
[enigma2.git] / lib / python / Components / Language.py
index bd188e5..c60b39b 100644 (file)
@@ -1,9 +1,12 @@
 import gettext
 import os
 
+from Tools.Directories import *
+
 class Language:
        def __init__(self):
-               gettext.install('enigma2', '/enigma2/po')
+               gettext.install('enigma2', '/enigma2/po', unicode=1)
+               self.activeLanguage = 0
                self.lang = []
                # FIXME make list dynamically
                self.addLanguage(_("English"), "en")
@@ -11,7 +14,7 @@ class Language:
 
        def addLanguage(self, name, lang):
                try:
-                       self.lang.append((_(name), gettext.translation('enigma2', '/enigma2/po', languages=[lang]), lang))
+                       self.lang.append((_(name), gettext.translation('enigma2', resolveFilename(SCOPE_LANGUAGE, ""), languages=[lang]), lang))
                except:
                        print "Language " + str(name) + " not found"
 
@@ -19,6 +22,7 @@ class Language:
                try:
                        print "Activating language " + str(self.lang[index][0])
                        self.lang[index][1].install()
+                       self.activeLanguage = index
                except:
                        print "Selected language does not exist!"