add some translations (translations in the wizard don't work in some places)
[vuplus_dvbapp] / lib / python / Screens / LanguageSelection.py
index af1e34c..e845d84 100644 (file)
@@ -3,17 +3,22 @@ from Screen import Screen
 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):
        def __init__(self, session):
                Screen.__init__(self, session)
                
                self.list = []
-               list = language.getLanguageList()
-               for x in list:
-                       self.list.append((x, None))
-
-               self["list"] = MenuList(self.list)
+               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"], 
                {
@@ -22,7 +27,10 @@ class LanguageSelection(Screen):
                })
                
        def save(self):
-               pass
+               self.run()
+               self.close()
        
        def run(self):
                language.activateLanguage(self["list"].l.getCurrentSelectionIndex())
+               config.osd.language.value = self["list"].l.getCurrentSelectionIndex()
+               config.osd.language.save()