Added some translatable messages

This commit is contained in:
Manuel Cortéz 2017-02-19 21:01:13 -06:00
parent 0e9b22612a
commit 856c91c483
10 changed files with 30 additions and 30 deletions

View File

@ -24,14 +24,14 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'adds the current word to the exceptions dictionary'
return _('adds the current word to the exceptions dictionary')
def updateSpellLanguage(self):
self.spellChecker = enchant.Dict(self.env['runtime']['settingsManager'].getSetting('general', 'spellCheckLanguage'))
self.language = self.env['runtime']['settingsManager'].getSetting('general', 'spellCheckLanguage')
def run(self):
if not initialized:
self.env['runtime']['outputManager'].presentText('pychant is not installed', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('pyenchant is not installed'), interrupt=True)
return
if self.env['runtime']['settingsManager'].getSetting('general', 'spellCheckLanguage') != self.language:
try:
@ -46,10 +46,10 @@ class command():
if currWord != '':
if self.spellChecker.is_added(currWord):
self.env['runtime']['outputManager'].presentText(currWord + ' is already in dict',soundIcon='Cancel', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('{0} is already in dict').format(currWord,), soundIcon='Cancel', interrupt=True)
else:
self.spellChecker.add(currWord)
self.env['runtime']['outputManager'].presentText(currWord + ' added',soundIcon='Accept', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('{0} added').format(currWord,), soundIcon='Accept', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -16,18 +16,18 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'read Bookmark ' + self.ID
return _('read Bookmark {0}').format(self.ID,)
def run(self):
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
if not self.env['commandBuffer']['bookMarks'][self.ID]:
self.env['runtime']['outputManager'].presentText("Bookmark " + self.ID + "not set", interrupt=True)
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
return
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
return
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
self.env['runtime']['outputManager'].presentText("Bookmark for application " + currApp + " not set", interrupt=True)
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
return
# set marks
@ -40,7 +40,7 @@ class command():
x, y, marked = \
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
if marked.isspace():
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)

View File

@ -14,14 +14,14 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'enables and disables output in braille'
return _('enables and disables output in braille')
def run(self):
if self.env['runtime']['settingsManager'].getSettingAsBool('braille', 'enabled'):
self.env['runtime']['outputManager'].presentText("braille disabled", soundIcon='BrailleOff', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('braille disabled'), soundIcon='BrailleOff', interrupt=True)
self.env['runtime']['settingsManager'].setSetting('braille', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('braille', 'enabled')))
if self.env['runtime']['settingsManager'].getSettingAsBool('braille', 'enabled'):
self.env['runtime']['outputManager'].presentText("braille enabled", soundIcon='BrailleOn', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('braille enabled'), soundIcon='BrailleOn', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -13,14 +13,14 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'enables or disables announcement of emoticons insteed of chars'
return _('enables or disables announcement of emoticons instead of chars')
def run(self):
self.env['runtime']['settingsManager'].setSetting('general', 'emoticons', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons')))
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons'):
self.env['runtime']['outputManager'].presentText("emoticons enabled", soundIcon='', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('emoticons enabled'), soundIcon='', interrupt=True)
else:
self.env['runtime']['outputManager'].presentText("emoticons disabled", soundIcon='', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('emoticons disabled'), soundIcon='', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -13,7 +13,7 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'enables or disables tracking of highlighted'
return _('enables or disables tracking of highlighted')
def run(self):
currMode = self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight')
@ -21,9 +21,9 @@ class command():
self.env['runtime']['settingsManager'].setSetting('focus', 'highlight', str(not currMode))
self.env['runtime']['settingsManager'].setSetting('focus', 'cursor', str(currMode))
if self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'):
self.env['runtime']['outputManager'].presentText("highlight tracking", soundIcon='', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('highlight tracking'), soundIcon='', interrupt=True)
else:
self.env['runtime']['outputManager'].presentText("cursor tracking", soundIcon='', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('cursor tracking'), soundIcon='', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -14,13 +14,13 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'toggles all output settings'
return _('toggles all output settings')
def run(self):
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled') or \
self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled') or \
self.env['runtime']['settingsManager'].getSettingAsBool('braille', 'enabled'):
self.env['runtime']['outputManager'].presentText("fenrir muted", soundIcon='Accept', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('Fenrir muted'), soundIcon='Accept', interrupt=True)
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled','False')
self.env['runtime']['settingsManager'].setSetting('sound', 'enabled','False')
self.env['runtime']['settingsManager'].setSetting('braille', 'enabled','False')
@ -28,7 +28,7 @@ class command():
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled','True')
self.env['runtime']['settingsManager'].setSetting('sound', 'enabled','True')
self.env['runtime']['settingsManager'].setSetting('braille', 'enabled','True')
self.env['runtime']['outputManager'].presentText("fenrir unmuted", soundIcon='Cancel', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('Fenrir unmuted), soundIcon='Cancel', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -20,7 +20,7 @@ class command():
if self.env['runtime']['punctuationManager'].cyclePunctuation():
self.env['runtime']['outputManager'].presentText(self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel'), interrupt=True, ignorePunctuation=True)
else:
self.env['runtime']['outputManager'].presentText('No punctuation found.', interrupt=True, ignorePunctuation=True)
self.env['runtime']['outputManager'].presentText(_('No punctuation found.'), interrupt=True, ignorePunctuation=True)
def setCallback(self, callback):
pass

View File

@ -14,14 +14,14 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'enables or disables sound'
return _('enables or disables sound')
def run(self):
if self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled'):
self.env['runtime']['outputManager'].presentText("sound disabled", soundIcon='SoundOff', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('sound disabled'), soundIcon='SoundOff', interrupt=True)
self.env['runtime']['settingsManager'].setSetting('sound', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled')))
if self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled'):
self.env['runtime']['outputManager'].presentText("sound enabled", soundIcon='SoundOn', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('sound enabled'), soundIcon='SoundOn', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -14,14 +14,14 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'enables or disables speech'
return _('enables or disables speech')
def run(self):
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'):
self.env['runtime']['outputManager'].presentText("speech disabled", soundIcon='SpeechOff', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('speech disabled'), soundIcon='SpeechOff', interrupt=True)
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled')))
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'):
self.env['runtime']['outputManager'].presentText("speech enabled", soundIcon='SpeechOn', interrupt=True)
self.env['runtime']['outputManager'].presentText(_('speech enabled'), soundIcon='SpeechOn', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -15,10 +15,10 @@ class command():
pass
def getDescription(self):
self.env['generalInformation']['tutorialMode'] = False
return 'You are leving the tutorial mode. Press that shortcut again to enter the tutorial mode again.'
return _('You are leaving the tutorial mode. Press that shortcut again to enter the tutorial mode again.')
def run(self):
text = 'you entered the tutorial mode. In that mode the commands are not executed. but you get a description of what the shortcut does. To leve the tutorial mode, press that shortcut again.'
text = _('you entered the tutorial mode. In that mode the commands are not executed. but you get a description of what the shortcut does. To leave the tutorial mode, press that shortcut again.')
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
self.env['generalInformation']['tutorialMode'] = True