some basic language support (already working a bit)
[enigma2.git] / lib / python / Components / SetupDevices.py
index cb2badb08167103520d807e3ff63a3cf619d51e7..6ce8737ba50bffb0b2dbf21621d0aae920f4f72a 100644 (file)
@@ -5,10 +5,17 @@ from config import ConfigSubsection
 from config import ConfigSlider
 from config import configSelection
 from config import configText
+from Components.Timezones import timezones
+from Components.Language import language
 
 def InitSetupDevices():
+       
+       def timezoneNotifier(configElement):
+               timezones.activateTimezone(configElement.value)
+               
        config.timezone = ConfigSubsection();
-       config.timezone.val = configElement("config.timezone.val", configSelection, 1, ("GMT", "GMT+1", "GMT+2", "GMT+3", "GMT+4", "GMT+5", "GMT+6", "GMT+7", "GMT+8", "GMT+9") );
+       config.timezone.val = configElement("config.timezone.val", configSelection, timezones.getDefaultTimezone(), timezones.getTimezoneList());
+       config.timezone.val.addNotifier(timezoneNotifier)
 
        config.rc = ConfigSubsection();
        config.rc.map = configElement("config.rc.map", configSelection, 0, ("Default", "Classic") );
@@ -20,7 +27,12 @@ def InitSetupDevices():
        config.osd.alpha = configElement("config.osd.alpha", ConfigSlider, 0, "");
        config.osd.bright = configElement("config.osd.bright", ConfigSlider, 5, "");
        config.osd.contrast = configElement("config.osd.contrast", ConfigSlider, 5, "");
-       config.osd.language = configElement("config.osd.language", configSelection, 0, ("English", "English US") );
+       
+       def languageNotifier(configElement):
+               language.activateLanguage(configElement.value)
+       
+       config.osd.language = configElement("config.osd.language", configSelection, 0, language.getLanguageList() );
+       config.osd.language.addNotifier(languageNotifier)
 
        config.parental = ConfigSubsection();
        config.parental.lock = configElement("config.parental.lock", configSelection, 1, ("Enable", "Disable") );