From 93ca22fdd2ac07e2fe934e0caca52d83fc1ca5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Sun, 26 Feb 2017 16:04:55 -0600 Subject: [PATCH] Translation implemented for hook commands --- src/fenrir/commands/onInput/15000-enable_temp_speech.py | 4 ++-- .../onInput/55000-present_line_if_cursor_change_vertical.py | 2 +- src/fenrir/commands/onInput/56000-highlight_tracking.py | 2 +- src/fenrir/commands/onInput/62000-spell_check.py | 2 +- src/fenrir/commands/onInput/72000-history.py | 2 +- src/fenrir/commands/onInput/80000-capslock.py | 4 ++-- src/fenrir/commands/onInput/80300-scrolllock.py | 4 ++-- src/fenrir/commands/onInput/80500-numlock.py | 4 ++-- .../onScreenChanged/80000-screen_change_announcement.py | 2 +- src/fenrir/commands/onScreenUpdate/76000-time.py | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/fenrir/commands/onInput/15000-enable_temp_speech.py b/src/fenrir/commands/onInput/15000-enable_temp_speech.py index e9d3d85c..a6de077e 100644 --- a/src/fenrir/commands/onInput/15000-enable_temp_speech.py +++ b/src/fenrir/commands/onInput/15000-enable_temp_speech.py @@ -14,7 +14,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'disables speech until next keypress' + return _('disables speech until next keypress') def run(self): if self.env['runtime']['inputManager'].noKeyPressed(): @@ -25,7 +25,7 @@ class command(): return self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress'])) 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): pass diff --git a/src/fenrir/commands/onInput/55000-present_line_if_cursor_change_vertical.py b/src/fenrir/commands/onInput/55000-present_line_if_cursor_change_vertical.py index ca1a8de5..5fc81cee 100644 --- a/src/fenrir/commands/onInput/55000-present_line_if_cursor_change_vertical.py +++ b/src/fenrir/commands/onInput/55000-present_line_if_cursor_change_vertical.py @@ -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']) 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: self.env['runtime']['outputManager'].presentText(currLine, interrupt=True, flush=False) diff --git a/src/fenrir/commands/onInput/56000-highlight_tracking.py b/src/fenrir/commands/onInput/56000-highlight_tracking.py index 8cc0fb07..8797fe1d 100644 --- a/src/fenrir/commands/onInput/56000-highlight_tracking.py +++ b/src/fenrir/commands/onInput/56000-highlight_tracking.py @@ -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): if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'): diff --git a/src/fenrir/commands/onInput/62000-spell_check.py b/src/fenrir/commands/onInput/62000-spell_check.py index ee78e8f6..0b912a88 100644 --- a/src/fenrir/commands/onInput/62000-spell_check.py +++ b/src/fenrir/commands/onInput/62000-spell_check.py @@ -129,7 +129,7 @@ class command(): pass 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): pass diff --git a/src/fenrir/commands/onInput/72000-history.py b/src/fenrir/commands/onInput/72000-history.py index 48b16434..99b3849b 100644 --- a/src/fenrir/commands/onInput/72000-history.py +++ b/src/fenrir/commands/onInput/72000-history.py @@ -47,7 +47,7 @@ class command(): announce = currLine 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: self.env['runtime']['outputManager'].presentText(announce, interrupt=True, flush=False) self.env['commandsIgnore']['onScreenUpdate']['CHAR_DELETE_ECHO'] = True diff --git a/src/fenrir/commands/onInput/80000-capslock.py b/src/fenrir/commands/onInput/80000-capslock.py index f5ac8c78..84819bc5 100644 --- a/src/fenrir/commands/onInput/80000-capslock.py +++ b/src/fenrir/commands/onInput/80000-capslock.py @@ -19,9 +19,9 @@ class command(): if self.env['input']['oldCapsLock'] == self.env['input']['newCapsLock']: return if self.env['input']['newCapsLock']: - self.env['runtime']['outputManager'].presentText("Capslock on", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("Capslock on"), interrupt=True) else: - self.env['runtime']['outputManager'].presentText("Capslock off", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("Capslock off"), interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/onInput/80300-scrolllock.py b/src/fenrir/commands/onInput/80300-scrolllock.py index 42033684..f159a4a0 100644 --- a/src/fenrir/commands/onInput/80300-scrolllock.py +++ b/src/fenrir/commands/onInput/80300-scrolllock.py @@ -19,9 +19,9 @@ class command(): if self.env['input']['oldScrollLock'] == self.env['input']['newScrollLock']: return if self.env['input']['newScrollLock']: - self.env['runtime']['outputManager'].presentText("Scrolllock on", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("Scrolllock on"), interrupt=True) else: - self.env['runtime']['outputManager'].presentText("Scrolllock off", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("Scrolllock off"), interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/onInput/80500-numlock.py b/src/fenrir/commands/onInput/80500-numlock.py index 74283d1f..86ab5341 100644 --- a/src/fenrir/commands/onInput/80500-numlock.py +++ b/src/fenrir/commands/onInput/80500-numlock.py @@ -19,9 +19,9 @@ class command(): if self.env['input']['oldNumLock'] == self.env['input']['newNumLock']: return if self.env['input']['newNumLock']: - self.env['runtime']['outputManager'].presentText("Numlock on", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("Numlock on"), interrupt=True) else: - self.env['runtime']['outputManager'].presentText("Numlock off", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("Numlock off"), interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/onScreenChanged/80000-screen_change_announcement.py b/src/fenrir/commands/onScreenChanged/80000-screen_change_announcement.py index 8da3e405..6fc9a395 100644 --- a/src/fenrir/commands/onScreenChanged/80000-screen_change_announcement.py +++ b/src/fenrir/commands/onScreenChanged/80000-screen_change_announcement.py @@ -17,7 +17,7 @@ class command(): return 'No Description found' 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) def setCallback(self, callback): diff --git a/src/fenrir/commands/onScreenUpdate/76000-time.py b/src/fenrir/commands/onScreenUpdate/76000-time.py index 4e9306df..3b9b55b6 100644 --- a/src/fenrir/commands/onScreenUpdate/76000-time.py +++ b/src/fenrir/commands/onScreenUpdate/76000-time.py @@ -63,7 +63,7 @@ class command(): if presentTime: # 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 if presentDate: self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=False)