add getTranslation method to wizard baseclass to allow overwriting this method for...
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 8 Jul 2008 10:58:42 +0000 (10:58 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 8 Jul 2008 10:58:42 +0000 (10:58 +0000)
lib/python/Screens/Wizard.py

index 9c9cbd30e97b8986b80a4878c07447e29ab04593..855df6ad16cbd9c368f4a4c677c03939b91f3442 100644 (file)
@@ -396,8 +396,11 @@ class Wizard(Screen, HelpableScreen):
                        print "code", code
                        exec(code)
                        
                        print "code", code
                        exec(code)
                        
+       def getTranslation(self, text):
+               return _(text)
+                       
        def updateText(self, firstset = False):
        def updateText(self, firstset = False):
-               text = _(self.wizard[self.currStep]["text"])
+               text = self.getTranslation(self.wizard[self.currStep]["text"])
                if text.find("[timeout]") != -1:
                        text = text.replace("[timeout]", str(self.timeoutCounter))
                        self["text"].setText(text)
                if text.find("[timeout]") != -1:
                        text = text.replace("[timeout]", str(self.timeoutCounter))
                        self["text"].setText(text)
@@ -429,7 +432,7 @@ class Wizard(Screen, HelpableScreen):
                        print "wizard step:", self.wizard[self.currStep]
                        
                        if self.showSteps:
                        print "wizard step:", self.wizard[self.currStep]
                        
                        if self.showSteps:
-                               self["step"].setText(_("Step ") + str(self.currStep) + "/" + str(self.numSteps))
+                               self["step"].setText(self.getTranslation("Step ") + str(self.currStep) + "/" + str(self.numSteps))
                        if self.showStepSlider:
                                self["stepslider"].setValue(self.currStep)
                
                        if self.showStepSlider:
                                self["stepslider"].setValue(self.currStep)
                
@@ -437,7 +440,7 @@ class Wizard(Screen, HelpableScreen):
                                self.resetCounter() 
                                self.timeoutTimer.start(1000)
                        
                                self.resetCounter() 
                                self.timeoutTimer.start(1000)
                        
-                       print "wizard text", _(self.wizard[self.currStep]["text"])
+                       print "wizard text", self.getTranslation(self.wizard[self.currStep]["text"])
                        self.updateText(firstset = True)
                        if self.wizard[self.currStep].has_key("displaytext"):
                                displaytext = self.wizard[self.currStep]["displaytext"]
                        self.updateText(firstset = True)
                        if self.wizard[self.currStep].has_key("displaytext"):
                                displaytext = self.wizard[self.currStep]["displaytext"]
@@ -471,7 +474,7 @@ class Wizard(Screen, HelpableScreen):
                                if (len(self.wizard[self.currStep]["list"]) > 0):
                                        #self["list"].instance.setZPosition(2)
                                        for x in self.wizard[self.currStep]["list"]:
                                if (len(self.wizard[self.currStep]["list"]) > 0):
                                        #self["list"].instance.setZPosition(2)
                                        for x in self.wizard[self.currStep]["list"]:
-                                               self.list.append((_(x[0]), x[1]))
+                                               self.list.append((self.getTranslation(x[0]), x[1]))
                                self.wizard[self.currStep]["evaluatedlist"] = self.list
                                self["list"].list = self.list
                                self["list"].index = 0
                                self.wizard[self.currStep]["evaluatedlist"] = self.list
                                self["list"].list = self.list
                                self["list"].index = 0