translation: don't fail when no language exists
authorFelix Domke <tmbinc@elitedvb.net>
Thu, 17 Nov 2005 21:44:53 +0000 (21:44 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Thu, 17 Nov 2005 21:44:53 +0000 (21:44 +0000)
lib/python/Components/Language.py

index 8d966b68653bb76e33889d9f101d4b0ca697447f..d6cdf17f675b8c0a19fac975d9f9cdec4ccbff02 100644 (file)
@@ -16,8 +16,11 @@ class Language:
                        print "Language " + str(name) + " not found"
 
        def activateLanguage(self, index):
                        print "Language " + str(name) + " not found"
 
        def activateLanguage(self, index):
-               print "Activating language " + str(self.lang[index][0])
-               self.lang[index][1].install()
+               try:
+                       print "Activating language " + str(self.lang[index][0])
+                       self.lang[index][1].install()
+               except:
+                       print "Selected language does not exist!"
                
        def getLanguageList(self):
                list = []
                
        def getLanguageList(self):
                list = []
@@ -25,4 +28,4 @@ class Language:
                        list.append(x[0])
                return list
 
                        list.append(x[0])
                return list
 
-language = Language()
\ No newline at end of file
+language = Language()