add some translations (translations in the wizard don't work in some places)
[vuplus_dvbapp] / lib / python / Screens / LanguageSelection.py
index 42f5420..e845d84 100644 (file)
@@ -4,6 +4,7 @@ from Components.MenuList import MenuList
 from Components.ActionMap import ActionMap
 from Components.Language import language
 from Components.LanguageList import *
+from Components.config import config
 
 
 class LanguageSelection(Screen):
@@ -11,11 +12,12 @@ class LanguageSelection(Screen):
                Screen.__init__(self, session)
                
                self.list = []
-               list = language.getLanguageList()
-               for x in language.lang:
-                       print x
-                       self.list.append(LanguageEntryComponent(x[2], x[0]))
-
+               if len(language.lang) == 0: # no language available => display only english
+                       self.list.append(LanguageEntryComponent("en", _("English")))
+               else:
+                       for x in language.lang:
+                               self.list.append(LanguageEntryComponent(x[2], x[0]))
+               
                self["list"] = LanguageList(self.list)
                
                self["actions"] = ActionMap(["OkCancelActions"], 
@@ -23,7 +25,6 @@ class LanguageSelection(Screen):
                        "ok": self.save,
                        "cancel": self.close
                })
-               print "INIT LANGUAGESELECTION"
                
        def save(self):
                self.run()
@@ -31,3 +32,5 @@ class LanguageSelection(Screen):
        
        def run(self):
                language.activateLanguage(self["list"].l.getCurrentSelectionIndex())
+               config.osd.language.value = self["list"].l.getCurrentSelectionIndex()
+               config.osd.language.save()