replace cvs -> git in control files
[enigma2-plugins.git] / networkwizard / src / WizardPluginLanguage.py
1 from Screens.Wizard import Wizard\r
2 from Components.Label import Label\r
3 from Components.Language import language\r
4 \r
5 # for localized messages\r
6 from __init__ import _\r
7 \r
8 class WizardPluginLanguage(Wizard):\r
9         def __init__(self, session, showSteps = True, showStepSlider = True, showList = True, showConfig = True):\r
10                 Wizard.__init__(self, session, showSteps, showStepSlider, showList, showConfig)\r
11                 self["languagetext"] = Label()\r
12                 self.updateLanguageDescription()\r
13                 \r
14         def red(self):\r
15                 self.resetCounter()\r
16                 self.languageSelect()\r
17                 \r
18         def languageSelect(self):\r
19                 print "languageSelect"\r
20                 newlanguage = language.getActiveLanguageIndex() + 1\r
21                 if newlanguage >= len(language.getLanguageList()):\r
22                         newlanguage = 0\r
23                 language.activateLanguageIndex(newlanguage)\r
24                 \r
25                 self.updateTexts()\r
26                 \r
27         def updateLanguageDescription(self):\r
28                 print language.getLanguageList()[language.getActiveLanguageIndex()]\r
29                 self["languagetext"].setText(self.getTranslation(language.getLanguageList()[language.getActiveLanguageIndex()][1][0]))\r
30                 \r
31         def updateTexts(self):\r
32                 print "updateTexts"\r
33                 self.updateText(firstset = True)\r
34                 self.updateValues()\r
35                 self.updateLanguageDescription()\r
36                 \r
37         def getTranslation(self, text):\r
38                 return _(text)\r
39 \r
40 \r
41 \r