From e3626cbb8e9d0649f9180899947cd928a070a55d Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Tue, 8 Jul 2008 10:58:42 +0000 Subject: [PATCH 1/1] add getTranslation method to wizard baseclass to allow overwriting this method for plugin translations --- lib/python/Screens/Wizard.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py index 9c9cbd30..855df6ad 100644 --- a/lib/python/Screens/Wizard.py +++ b/lib/python/Screens/Wizard.py @@ -396,8 +396,11 @@ class Wizard(Screen, HelpableScreen): print "code", code exec(code) + def getTranslation(self, text): + return _(text) + 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) @@ -429,7 +432,7 @@ class Wizard(Screen, HelpableScreen): 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) @@ -437,7 +440,7 @@ class Wizard(Screen, HelpableScreen): 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"] @@ -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"]: - 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 -- 2.30.2