Translation implemented for hook commands

This commit is contained in:
Manuel Cortéz 2017-02-26 16:04:55 -06:00
parent 65d5d7f48a
commit 93ca22fdd2
10 changed files with 14 additions and 14 deletions

View File

@ -14,7 +14,7 @@ class command():
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'disables speech until next keypress' return _('disables speech until next keypress')
def run(self): def run(self):
if self.env['runtime']['inputManager'].noKeyPressed(): if self.env['runtime']['inputManager'].noKeyPressed():
@ -25,7 +25,7 @@ class command():
return return
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress'])) self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress']))
self.env['commandBuffer']['enableSpeechOnKeypress'] = False self.env['commandBuffer']['enableSpeechOnKeypress'] = False
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): def setCallback(self, callback):
pass pass

View File

@ -35,7 +35,7 @@ class command():
x, y, currLine = line_utils.getCurrentLine(self.env['screenData']['newCursor']['x'], self.env['screenData']['newCursor']['y'], self.env['screenData']['newContentText']) x, y, currLine = line_utils.getCurrentLine(self.env['screenData']['newCursor']['x'], self.env['screenData']['newCursor']['y'], self.env['screenData']['newContentText'])
if currLine.isspace(): if currLine.isspace():
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
else: else:
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(currLine, interrupt=True, flush=False)

View File

@ -13,7 +13,7 @@ class command():
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'enables or disables tracking of highlighted' return _('enables or disables tracking of highlighted')
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'): if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'):

View File

@ -129,7 +129,7 @@ class command():
pass pass
if not self.spellChecker.check(currWord): if not self.spellChecker.check(currWord):
self.env['runtime']['outputManager'].presentText('misspelled',soundIcon='mispell', interrupt=False, flush=False) self.env['runtime']['outputManager'].presentText(_('misspelled'), soundIcon='mispell', interrupt=False, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -47,7 +47,7 @@ class command():
announce = currLine announce = currLine
if currLine.isspace(): if currLine.isspace():
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
else: else:
self.env['runtime']['outputManager'].presentText(announce, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(announce, interrupt=True, flush=False)
self.env['commandsIgnore']['onScreenUpdate']['CHAR_DELETE_ECHO'] = True self.env['commandsIgnore']['onScreenUpdate']['CHAR_DELETE_ECHO'] = True

View File

@ -19,9 +19,9 @@ class command():
if self.env['input']['oldCapsLock'] == self.env['input']['newCapsLock']: if self.env['input']['oldCapsLock'] == self.env['input']['newCapsLock']:
return return
if self.env['input']['newCapsLock']: if self.env['input']['newCapsLock']:
self.env['runtime']['outputManager'].presentText("Capslock on", interrupt=True) self.env['runtime']['outputManager'].presentText(_("Capslock on"), interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText("Capslock off", interrupt=True) self.env['runtime']['outputManager'].presentText(_("Capslock off"), interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -19,9 +19,9 @@ class command():
if self.env['input']['oldScrollLock'] == self.env['input']['newScrollLock']: if self.env['input']['oldScrollLock'] == self.env['input']['newScrollLock']:
return return
if self.env['input']['newScrollLock']: if self.env['input']['newScrollLock']:
self.env['runtime']['outputManager'].presentText("Scrolllock on", interrupt=True) self.env['runtime']['outputManager'].presentText(_("Scrolllock on"), interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText("Scrolllock off", interrupt=True) self.env['runtime']['outputManager'].presentText(_("Scrolllock off"), interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -19,9 +19,9 @@ class command():
if self.env['input']['oldNumLock'] == self.env['input']['newNumLock']: if self.env['input']['oldNumLock'] == self.env['input']['newNumLock']:
return return
if self.env['input']['newNumLock']: if self.env['input']['newNumLock']:
self.env['runtime']['outputManager'].presentText("Numlock on", interrupt=True) self.env['runtime']['outputManager'].presentText(_("Numlock on"), interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText("Numlock off", interrupt=True) self.env['runtime']['outputManager'].presentText(_("Numlock off"), interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -17,7 +17,7 @@ class command():
return 'No Description found' return 'No Description found'
def run(self): def run(self):
self.env['runtime']['outputManager'].presentText("screen " + str(self.env['screenData']['newTTY']),soundIcon='ChangeTTY', interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("screen {0}").format(self.env['screenData']['newTTY']),soundIcon='ChangeTTY', interrupt=True, flush=False)
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newContentText'], interrupt=False, flush=False) self.env['runtime']['outputManager'].presentText(self.env['screenData']['newContentText'], interrupt=False, flush=False)
def setCallback(self, callback): def setCallback(self, callback):

View File

@ -63,7 +63,7 @@ class command():
if presentTime: if presentTime:
# present the time # present the time
self.env['runtime']['outputManager'].presentText('Autotime: ' + timeString , soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(_('Autotime: {0}').format(timeString), soundIcon='', interrupt=False)
# and date if changes # and date if changes
if presentDate: if presentDate:
self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=False)