Permalink
Browse files

added language fallback if language is not translated

  • Loading branch information...
1 parent c6a718b commit 4a33bffa1d341df5ce4d839a6d27972dfed4e0a2 @Eichhoernchen committed Apr 15, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 plugin.py
View
@@ -169,14 +169,12 @@ def getCurrentLocation(self, force_reload=False, accuracy=GetRequestOrigin.desir
#We need to say something
view1 = UIAssistantUtteranceView()
- view1.text=__error_location_help__[self.__lang]
- view1.speakableText=__error_location_help__[self.__lang]
+ view1.text = view1.speakableText = __error_location_help__[self.__lang] if self.__lang in __error_location_help__ else __error_location_help__['en-US']
view1.dialogIdentifier="Common#assistantLocationServicesDisabled"
#lets create another which has tells him to open settings
view2 = UIAssistantUtteranceView()
- view2.text=__error_location_saysettings__[self.__lang]
- view2.speakableText=__error_location_saysettings__[self.__lang]
+ view2.text = view2.speakableText = __error_location_saysettings__[self.__lang] if self.__lang in __error_location_saysettings__ else __error_location_saysettings__['en-US']
view2.dialogIdentifier="Common#assistantLocationServicesDisabled"
#create a link
@@ -185,7 +183,7 @@ def getCurrentLocation(self, force_reload=False, accuracy=GetRequestOrigin.desir
# create a button which opens the location tab in the settings if clicked on it
button = UIButton()
- button.text=__error_location_settings__[self.__lang]
+ button.text = __error_location_settings__[self.__lang] if self.__lang in __error_location_settings__ else __error_location_settings__['en-US']
button.commands = [link]
# wrap it up in a adds view

0 comments on commit 4a33bff

Please sign in to comment.