1 from Screen import Screen
3 from Components.MenuList import MenuList
4 from Components.ActionMap import ActionMap
5 from Components.Language import language
6 from Components.LanguageList import *
7 from Components.config import config
10 class LanguageSelection(Screen):
11 def __init__(self, session):
12 Screen.__init__(self, session)
15 self["list"] = LanguageList(self.list)
17 self.onLayoutFinish.append(self.selectActiveLanguage)
19 self["actions"] = ActionMap(["OkCancelActions", "DirectionActions"],
29 def selectActiveLanguage(self):
30 self["list"].instance.moveSelectionTo(language.activeLanguage)
37 language.activateLanguage(self["list"].l.getCurrentSelectionIndex())
38 config.osd.language.value = self["list"].l.getCurrentSelectionIndex()
39 config.osd.language.save()
40 self.setTitle(_("Language selection"))
44 if len(language.lang) == 0: # no language available => display only english
45 self.list.append(LanguageEntryComponent("en", _("English")))
47 for x in language.lang:
48 self.list.append(LanguageEntryComponent(x[3].lower(), _(x[0])))
50 self["list"].l.setList(self.list)
53 self["list"].instance.moveSelection(self["list"].instance.moveUp)
58 self["list"].instance.moveSelection(self["list"].instance.moveDown)
63 self["list"].instance.moveSelection(self["list"].instance.pageUp)
68 self["list"].instance.moveSelection(self["list"].instance.pageDown)