From 65d5d7f48ada7a3bd766de58e47bd4718ffcd995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Sun, 26 Feb 2017 15:49:37 -0600 Subject: [PATCH] Finished translation implementation for all commands --- src/fenrir/commands/commands/cursor_position.py | 4 ++-- .../commands/commands/cursor_read_to_end_of_line.py | 4 ++-- src/fenrir/commands/commands/date.py | 2 +- src/fenrir/commands/commands/dec_sound_volume.py | 4 ++-- src/fenrir/commands/commands/dec_speech_pitch.py | 4 ++-- src/fenrir/commands/commands/dec_speech_rate.py | 4 ++-- src/fenrir/commands/commands/dec_speech_volume.py | 4 ++-- src/fenrir/commands/commands/exit_review.py | 6 +++--- src/fenrir/commands/commands/export_clipboard_to_x.py | 10 +++++----- src/fenrir/commands/commands/first_clipboard.py | 4 ++-- src/fenrir/commands/commands/forward_keypress.py | 4 ++-- src/fenrir/commands/commands/inc_sound_volume.py | 4 ++-- src/fenrir/commands/commands/inc_speech_pitch.py | 4 ++-- src/fenrir/commands/commands/inc_speech_rate.py | 4 ++-- src/fenrir/commands/commands/inc_speech_volume.py | 4 ++-- src/fenrir/commands/commands/indent_curr_line.py | 6 +++--- src/fenrir/commands/commands/last_clipboard.py | 4 ++-- src/fenrir/commands/commands/last_incoming.py | 2 +- src/fenrir/commands/commands/marked_text.py | 6 +++--- src/fenrir/commands/commands/next_clipboard.py | 6 +++--- src/fenrir/commands/commands/paste_clipboard.py | 10 +++++----- src/fenrir/commands/commands/present_first_line.py | 4 ++-- src/fenrir/commands/commands/present_last_line.py | 4 ++-- src/fenrir/commands/commands/prev_clipboard.py | 6 +++--- src/fenrir/commands/commands/quit_fenrir.py | 2 +- src/fenrir/commands/commands/remove_marks.py | 4 ++-- .../commands/commands/remove_word_from_spell_check.py | 8 ++++---- src/fenrir/commands/commands/review_bottom.py | 4 ++-- src/fenrir/commands/commands/review_curr_char.py | 2 +- .../commands/commands/review_curr_char_phonetic.py | 4 ++-- src/fenrir/commands/commands/review_curr_line.py | 4 ++-- src/fenrir/commands/commands/review_curr_word.py | 8 ++++---- .../commands/commands/review_curr_word_phonetic.py | 8 ++++---- src/fenrir/commands/commands/review_down.py | 4 ++-- src/fenrir/commands/commands/review_line_begin.py | 6 +++--- src/fenrir/commands/commands/review_line_end.py | 4 ++-- src/fenrir/commands/commands/review_line_first_char.py | 6 +++--- src/fenrir/commands/commands/review_line_last_char.py | 4 ++-- src/fenrir/commands/commands/review_next_char.py | 6 +++--- .../commands/commands/review_next_char_phonetic.py | 6 +++--- src/fenrir/commands/commands/review_next_line.py | 6 +++--- src/fenrir/commands/commands/review_next_word.py | 8 ++++---- .../commands/commands/review_next_word_phonetic.py | 8 ++++---- src/fenrir/commands/commands/review_prev_char.py | 6 +++--- .../commands/commands/review_prev_char_phonetic.py | 6 +++--- src/fenrir/commands/commands/review_prev_line.py | 6 +++--- src/fenrir/commands/commands/review_prev_word.py | 8 ++++---- .../commands/commands/review_prev_word_phonetic.py | 8 ++++---- src/fenrir/commands/commands/review_top.py | 4 ++-- src/fenrir/commands/commands/review_up.py | 6 +++--- src/fenrir/commands/commands/set_bookmark_1.py | 6 +++--- src/fenrir/commands/commands/set_bookmark_10.py | 6 +++--- src/fenrir/commands/commands/set_bookmark_2.py | 6 +++--- src/fenrir/commands/commands/set_bookmark_3.py | 6 +++--- src/fenrir/commands/commands/set_bookmark_4.py | 6 +++--- src/fenrir/commands/commands/set_bookmark_5.py | 6 +++--- src/fenrir/commands/commands/set_bookmark_6.py | 6 +++--- src/fenrir/commands/commands/set_bookmark_7.py | 6 +++--- src/fenrir/commands/commands/set_bookmark_8.py | 6 +++--- src/fenrir/commands/commands/set_bookmark_9.py | 6 +++--- src/fenrir/commands/commands/set_mark.py | 8 ++++---- src/fenrir/commands/commands/set_window_application.py | 6 +++--- src/fenrir/commands/commands/shut_up.py | 2 +- src/fenrir/commands/commands/spell_check.py | 10 +++++----- src/fenrir/commands/commands/subprocess.py | 8 ++++---- src/fenrir/commands/commands/temp_disable_speech.py | 4 ++-- src/fenrir/commands/commands/time.py | 2 +- src/fenrir/commands/commands/toggle_auto_read.py | 6 +++--- .../commands/commands/toggle_auto_spell_check.py | 6 +++--- src/fenrir/commands/commands/toggle_auto_time.py | 6 +++--- 70 files changed, 189 insertions(+), 189 deletions(-) diff --git a/src/fenrir/commands/commands/cursor_position.py b/src/fenrir/commands/commands/cursor_position.py index 9acc912d..99b13fab 100644 --- a/src/fenrir/commands/commands/cursor_position.py +++ b/src/fenrir/commands/commands/cursor_position.py @@ -14,13 +14,13 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'displays the position of the review cursor' + return _('displays the position of the review cursor') def run(self): # Prefer review cursor over text cursor cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() - self.env['runtime']['outputManager'].presentText("line "+ str(cursorPos['y']+1) + " column "+ str(cursorPos['x']+1), interrupt=True) + self.env['runtime']['outputManager'].presentText(_("line {0}, column {1}").format(cursorPos['y']+1, cursorPos['x']+1), interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/cursor_read_to_end_of_line.py b/src/fenrir/commands/commands/cursor_read_to_end_of_line.py index ba4c2eb5..a8c69d32 100644 --- a/src/fenrir/commands/commands/cursor_read_to_end_of_line.py +++ b/src/fenrir/commands/commands/cursor_read_to_end_of_line.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'read to end of line, use review cursor if you are in reviewmode, otherwhise use text cursor' + return _('read to end of line, use review cursor if you are in review mode, otherwhise use text cursor') def run(self): cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() @@ -24,7 +24,7 @@ class command(): line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText']) if currLine.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(currLine[cursorPos['x']], interrupt=True) self.env['runtime']['outputManager'].announceActiveCursor() diff --git a/src/fenrir/commands/commands/date.py b/src/fenrir/commands/commands/date.py index cbf3a380..39fc28ef 100644 --- a/src/fenrir/commands/commands/date.py +++ b/src/fenrir/commands/commands/date.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'presents the date' + return _('presents the date') def run(self): dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat') diff --git a/src/fenrir/commands/commands/dec_sound_volume.py b/src/fenrir/commands/commands/dec_sound_volume.py index 1cf1a640..c97414ce 100644 --- a/src/fenrir/commands/commands/dec_sound_volume.py +++ b/src/fenrir/commands/commands/dec_sound_volume.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'decrease sound volume' + return _('decrease sound volume') def run(self): @@ -26,7 +26,7 @@ class command(): value = 0.1 self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value)) - self.env['runtime']['outputManager'].presentText(str(int(value * 100)) + " percent sound volume", soundIcon='SoundOff', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("{0} percent sound volume").format(int(value * 100)), soundIcon='SoundOff', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/dec_speech_pitch.py b/src/fenrir/commands/commands/dec_speech_pitch.py index fa818db1..1caf6772 100644 --- a/src/fenrir/commands/commands/dec_speech_pitch.py +++ b/src/fenrir/commands/commands/dec_speech_pitch.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'decreases the pitch of the speech' + return _('decreases the pitch of the speech') def run(self): value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch') @@ -24,7 +24,7 @@ class command(): value = 0.0 self.env['runtime']['settingsManager'].setSetting('speech', 'pitch', str(value)) - self.env['runtime']['outputManager'].presentText(str(int(value * 100)) + " percent speech pitch", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("{0} percent speech pitch").format(int(value * 100)) soundIcon='', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/dec_speech_rate.py b/src/fenrir/commands/commands/dec_speech_rate.py index 244ba9b9..a0248662 100644 --- a/src/fenrir/commands/commands/dec_speech_rate.py +++ b/src/fenrir/commands/commands/dec_speech_rate.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'decreases the rate of the speech' + return _('decreases the rate of the speech') def run(self): value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate') @@ -24,7 +24,7 @@ class command(): value = 0.0 self.env['runtime']['settingsManager'].setSetting('speech', 'rate', str(value)) - self.env['runtime']['outputManager'].presentText(str(int(value * 100)) + " percent speech rate", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("{0} percent speech rate").format(int(value * 100)), soundIcon='', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/dec_speech_volume.py b/src/fenrir/commands/commands/dec_speech_volume.py index 6ad5ba02..946803cb 100644 --- a/src/fenrir/commands/commands/dec_speech_volume.py +++ b/src/fenrir/commands/commands/dec_speech_volume.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'decreases the volume of the speech' + return _('decreases the volume of the speech') def run(self): value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume') @@ -24,7 +24,7 @@ class command(): value = 0.1 self.env['runtime']['settingsManager'].setSetting('speech', 'volume', str(value)) - self.env['runtime']['outputManager'].presentText(str(int(value * 100)) + " percent speech volume", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("{0} percent speech volume").format(int(value * 100)), soundIcon='', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/exit_review.py b/src/fenrir/commands/commands/exit_review.py index 6e9c72c5..9c0369c4 100644 --- a/src/fenrir/commands/commands/exit_review.py +++ b/src/fenrir/commands/commands/exit_review.py @@ -14,15 +14,15 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'exits review mode' + return _('exits review mode') def run(self): if not self.env['runtime']['cursorManager'].isReviewMode(): - self.env['runtime']['outputManager'].presentText("Not in review mode", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("Not in review mode"), interrupt=True) return self.env['runtime']['cursorManager'].clearReviewCursor() - self.env['runtime']['outputManager'].presentText("leve review mode", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("leave review mode"), interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/export_clipboard_to_x.py b/src/fenrir/commands/commands/export_clipboard_to_x.py index 6a543243..4e64824a 100644 --- a/src/fenrir/commands/commands/export_clipboard_to_x.py +++ b/src/fenrir/commands/commands/export_clipboard_to_x.py @@ -18,7 +18,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'export the current fenrir clipboard to X clipboard' + return _('export the current fenrir clipboard to X clipboard') def run(self): _thread.start_new_thread(self._threadRun , ()) @@ -26,16 +26,16 @@ class command(): try: currClipboard = self.env['commandBuffer']['currClipboard'] if currClipboard < 0: - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return if not self.env['commandBuffer']['clipboard']: - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return if not self.env['commandBuffer']['clipboard'][currClipboard]: - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return if self.env['commandBuffer']['clipboard'][currClipboard] == '': - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return p = Popen('su -c "echo -n \"' + self.env['commandBuffer']['clipboard'][currClipboard] +'\" | xclip -selection c' + self.env['generalInformation']['currUser'] , stdout=PIPE, stderr=PIPE, shell=True) diff --git a/src/fenrir/commands/commands/first_clipboard.py b/src/fenrir/commands/commands/first_clipboard.py index c6cee34b..152f65ed 100644 --- a/src/fenrir/commands/commands/first_clipboard.py +++ b/src/fenrir/commands/commands/first_clipboard.py @@ -14,11 +14,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'selects the first clipboard' + return _('selects the first clipboard') def run(self): if len(self.env['commandBuffer']['clipboard']) == 0: - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return self.env['commandBuffer']['currClipboard'] = 0 self.env['runtime']['outputManager'].presentText(self.env['commandBuffer']['clipboard'][self.env['commandBuffer']['currClipboard']], interrupt=True) diff --git a/src/fenrir/commands/commands/forward_keypress.py b/src/fenrir/commands/commands/forward_keypress.py index 6aed1d65..c3e718fe 100644 --- a/src/fenrir/commands/commands/forward_keypress.py +++ b/src/fenrir/commands/commands/forward_keypress.py @@ -14,11 +14,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'sends the following keypress to the terminal' + return _('sends the following keypress to the terminal') def run(self): self.env['input']['keyForeward'] = 3 - self.env['runtime']['outputManager'].presentText('Foreward next keypress', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Forward next keypress'), interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/inc_sound_volume.py b/src/fenrir/commands/commands/inc_sound_volume.py index f3c31558..78eee847 100644 --- a/src/fenrir/commands/commands/inc_sound_volume.py +++ b/src/fenrir/commands/commands/inc_sound_volume.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'adjusts the volume for in coming sounds' + return _('adjusts the volume for in coming sounds') def run(self): @@ -26,7 +26,7 @@ class command(): value = 1.0 self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value)) - self.env['runtime']['outputManager'].presentText(str(int(value * 100)) + " percent sound volume", soundIcon='SoundOn', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("{0} percent sound volume").format(int(value * 100)), soundIcon='SoundOn', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/inc_speech_pitch.py b/src/fenrir/commands/commands/inc_speech_pitch.py index 3d99df97..cb267b66 100644 --- a/src/fenrir/commands/commands/inc_speech_pitch.py +++ b/src/fenrir/commands/commands/inc_speech_pitch.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'increases the pitch of the speech' + return _('increases the pitch of the speech') def run(self): value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch') @@ -24,7 +24,7 @@ class command(): value = 1.0 self.env['runtime']['settingsManager'].setSetting('speech', 'pitch', str(value)) - self.env['runtime']['outputManager'].presentText(str(int(value * 100)) + " percent speech pitch", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("{0} percent speech pitch").format(int(value * 100)), soundIcon='', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/inc_speech_rate.py b/src/fenrir/commands/commands/inc_speech_rate.py index 3f20ae6b..4db1763d 100644 --- a/src/fenrir/commands/commands/inc_speech_rate.py +++ b/src/fenrir/commands/commands/inc_speech_rate.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'increase the speech rate' + return _('increase the speech rate') def run(self): value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate') @@ -24,7 +24,7 @@ class command(): value = 1.0 self.env['runtime']['settingsManager'].setSetting('speech', 'rate', str(value)) - self.env['runtime']['outputManager'].presentText(str(int(value * 100)) + " percent speech rate", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("{0} percent speech rate").format(int(value * 100)), soundIcon='', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/inc_speech_volume.py b/src/fenrir/commands/commands/inc_speech_volume.py index 1ea41d32..1c6716e6 100644 --- a/src/fenrir/commands/commands/inc_speech_volume.py +++ b/src/fenrir/commands/commands/inc_speech_volume.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'increase the speech volume' + return _('increase the speech volume') def run(self): value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume') @@ -24,7 +24,7 @@ class command(): value = 1.0 self.env['runtime']['settingsManager'].setSetting('speech', 'volume', str(value)) - self.env['runtime']['outputManager'].presentText(str(int(value * 100)) + " percent speech volume", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("{0} percent speech volume").format(int(value * 100)), soundIcon='', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/indent_curr_line.py b/src/fenrir/commands/commands/indent_curr_line.py index 4cfe3bdf..948b30cd 100644 --- a/src/fenrir/commands/commands/indent_curr_line.py +++ b/src/fenrir/commands/commands/indent_curr_line.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'shows the indention level for the current line' + return _('shows the indention level for the current line') def run(self): # Prefer review cursor over text cursor @@ -28,9 +28,9 @@ class command(): line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText']) if currLine.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("indent "+ str(len(currLine) - len(currLine.lstrip())), interrupt=True) + self.env['runtime']['outputManager'].presentText(_("indent {0}").format(len(currLine) - len(currLine.lstrip())), interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/last_clipboard.py b/src/fenrir/commands/commands/last_clipboard.py index cf08b299..2d8d2f5c 100644 --- a/src/fenrir/commands/commands/last_clipboard.py +++ b/src/fenrir/commands/commands/last_clipboard.py @@ -14,11 +14,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'selects the last clipboard' + return _('selects the last clipboard') def run(self): if len(self.env['commandBuffer']['clipboard']) == 0: - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return self.env['commandBuffer']['currClipboard'] = len(self.env['commandBuffer']['clipboard']) -1 self.env['runtime']['outputManager'].presentText(self.env['commandBuffer']['clipboard'][self.env['commandBuffer']['currClipboard']], interrupt=True) diff --git a/src/fenrir/commands/commands/last_incoming.py b/src/fenrir/commands/commands/last_incoming.py index 84b2f46a..4c2e2a7c 100644 --- a/src/fenrir/commands/commands/last_incoming.py +++ b/src/fenrir/commands/commands/last_incoming.py @@ -14,7 +14,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'displays the last received text' + return _('displays the last received text') def run(self): self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=True) diff --git a/src/fenrir/commands/commands/marked_text.py b/src/fenrir/commands/commands/marked_text.py index 7e7bc323..205757b6 100644 --- a/src/fenrir/commands/commands/marked_text.py +++ b/src/fenrir/commands/commands/marked_text.py @@ -15,12 +15,12 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'speaks the currently selected text that will be copied to the clipboard' + return _('speaks the currently selected text that will be copied to the clipboard') def run(self): if not (self.env['commandBuffer']['Marks']['1'] and \ self.env['commandBuffer']['Marks']['2']): - self.env['runtime']['outputManager'].presentText("please set begin and endmark", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("please set begin and endmark"), interrupt=True) return # use the last first and the last setted mark as range @@ -30,7 +30,7 @@ class command(): marked = mark_utils.getTextBetweenMarks(startMark, endMark, 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) diff --git a/src/fenrir/commands/commands/next_clipboard.py b/src/fenrir/commands/commands/next_clipboard.py index 457bd9b6..7e3d2070 100644 --- a/src/fenrir/commands/commands/next_clipboard.py +++ b/src/fenrir/commands/commands/next_clipboard.py @@ -14,16 +14,16 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'selects the next clipboard' + return _('selects the next clipboard') def run(self): if len(self.env['commandBuffer']['clipboard']) == 0: - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return self.env['commandBuffer']['currClipboard'] += 1 if self.env['commandBuffer']['currClipboard'] > len(self.env['commandBuffer']['clipboard']) -1: self.env['commandBuffer']['currClipboard'] = 0 - self.env['runtime']['outputManager'].presentText('First clipboard ', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True) self.env['runtime']['outputManager'].presentText(self.env['commandBuffer']['clipboard'][self.env['commandBuffer']['currClipboard']], interrupt=False) else: self.env['runtime']['outputManager'].presentText(self.env['commandBuffer']['clipboard'][self.env['commandBuffer']['currClipboard']], interrupt=True) diff --git a/src/fenrir/commands/commands/paste_clipboard.py b/src/fenrir/commands/commands/paste_clipboard.py index b9879135..02a74cc0 100644 --- a/src/fenrir/commands/commands/paste_clipboard.py +++ b/src/fenrir/commands/commands/paste_clipboard.py @@ -15,21 +15,21 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'pastes the text from the currently selected clipboard' + return _('pastes the text from the currently selected clipboard') def run(self): currClipboard = self.env['commandBuffer']['currClipboard'] if currClipboard < 0: - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return if not self.env['commandBuffer']['clipboard']: - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return if not self.env['commandBuffer']['clipboard'][currClipboard]: - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return if self.env['commandBuffer']['clipboard'][currClipboard] == '': - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return self.env['runtime']['outputManager'].presentText('paste clipboard', soundIcon='PasteClipboardOnScreen', interrupt=True) time.sleep(0.01) diff --git a/src/fenrir/commands/commands/present_first_line.py b/src/fenrir/commands/commands/present_first_line.py index 40954173..385f199f 100644 --- a/src/fenrir/commands/commands/present_first_line.py +++ b/src/fenrir/commands/commands/present_first_line.py @@ -15,14 +15,14 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'present first line' + return _('present first line') def run(self): x, y, firstLine = \ line_utils.getCurrentLine(0, 0, self.env['screenData']['newContentText']) if firstLine.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(firstLine, interrupt=True) def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/present_last_line.py b/src/fenrir/commands/commands/present_last_line.py index f53af172..ec83a2af 100644 --- a/src/fenrir/commands/commands/present_last_line.py +++ b/src/fenrir/commands/commands/present_last_line.py @@ -15,14 +15,14 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'current line' + return _('current line') def run(self): x, y, lastLine = \ line_utils.getCurrentLine(0, self.env['screenData']['lines'] -1, self.env['screenData']['newContentText']) if lastLine.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(lastLine, interrupt=True) def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/prev_clipboard.py b/src/fenrir/commands/commands/prev_clipboard.py index 8659d662..197d34ee 100644 --- a/src/fenrir/commands/commands/prev_clipboard.py +++ b/src/fenrir/commands/commands/prev_clipboard.py @@ -14,16 +14,16 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'selects the previous clipboard' + return _('selects the previous clipboard') def run(self): if len(self.env['commandBuffer']['clipboard']) == 0: - self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return self.env['commandBuffer']['currClipboard'] -= 1 if self.env['commandBuffer']['currClipboard'] < 0: self.env['commandBuffer']['currClipboard'] = len(self.env['commandBuffer']['clipboard']) -1 - self.env['runtime']['outputManager'].presentText('Last clipboard ', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True) self.env['runtime']['outputManager'].presentText(self.env['commandBuffer']['clipboard'][self.env['commandBuffer']['currClipboard']], interrupt=False) else: self.env['runtime']['outputManager'].presentText(self.env['commandBuffer']['clipboard'][self.env['commandBuffer']['currClipboard']], interrupt=True) diff --git a/src/fenrir/commands/commands/quit_fenrir.py b/src/fenrir/commands/commands/quit_fenrir.py index 0be6540c..f79060aa 100644 --- a/src/fenrir/commands/commands/quit_fenrir.py +++ b/src/fenrir/commands/commands/quit_fenrir.py @@ -14,7 +14,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'exits Fenrir' + return _('exits Fenrir') def run(self): self.env['generalInformation']['running'] = False diff --git a/src/fenrir/commands/commands/remove_marks.py b/src/fenrir/commands/commands/remove_marks.py index a180d853..0c2547e4 100644 --- a/src/fenrir/commands/commands/remove_marks.py +++ b/src/fenrir/commands/commands/remove_marks.py @@ -14,11 +14,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'removes marks from selected text' + return _('removes marks from selected text') def run(self): self.env['runtime']['cursorManager'].clearMarks() - self.env['runtime']['outputManager'].presentText('Remove marks', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Remove marks'), interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/remove_word_from_spell_check.py b/src/fenrir/commands/commands/remove_word_from_spell_check.py index 3da3e665..0b860bf9 100644 --- a/src/fenrir/commands/commands/remove_word_from_spell_check.py +++ b/src/fenrir/commands/commands/remove_word_from_spell_check.py @@ -24,14 +24,14 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'removes the current word from the exceptions dictionary' + return _('removes the current word from 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: @@ -47,9 +47,9 @@ class command(): currWord = currWord.strip(string.whitespace + '!"#$%&\()*+,-./:;<=ยง>?@[\\]^_{|}~') if not currWord.isspace(): if self.spellChecker.is_removed(currWord): - self.env['runtime']['outputManager'].presentText(currWord + ' is already removed from dict',soundIcon='Cancel', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('{0} is already removed from dict').format(currWord,), soundIcon='Cancel', interrupt=True) else: self.spellChecker.remove(currWord) - self.env['runtime']['outputManager'].presentText(currWord + ' removed',soundIcon='Accept', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('{0} removed').format(currWord,), soundIcon='Accept', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_bottom.py b/src/fenrir/commands/commands/review_bottom.py index b817280e..98925c2d 100644 --- a/src/fenrir/commands/commands/review_bottom.py +++ b/src/fenrir/commands/commands/review_bottom.py @@ -14,11 +14,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'move review to bottom of screen' + return _('move review to bottom of screen') def run(self): self.env['screenData']['newCursorReview'] = { 'x': 0, 'y':self.env['screenData']['lines'] -1} - self.env['runtime']['outputManager'].presentText("Bottom", interrupt=True, flush=False) + self.env['runtime']['outputManager'].presentText(_("Bottom"), interrupt=True, flush=False) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_curr_char.py b/src/fenrir/commands/commands/review_curr_char.py index 25269564..5c9d08f6 100644 --- a/src/fenrir/commands/commands/review_curr_char.py +++ b/src/fenrir/commands/commands/review_curr_char.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'presents the current character.' + return _('presents the current character.') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() diff --git a/src/fenrir/commands/commands/review_curr_char_phonetic.py b/src/fenrir/commands/commands/review_curr_char_phonetic.py index 7fc5aae8..66947cb4 100644 --- a/src/fenrir/commands/commands/review_curr_char_phonetic.py +++ b/src/fenrir/commands/commands/review_curr_char_phonetic.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set review and phonetically presents the current character' + return _('set review and phonetically presents the current character') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() @@ -24,7 +24,7 @@ class command(): char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) if currChar.isspace(): - self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True, flush=False) + self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) else: currChar = char_utils.getPhonetic(currChar) self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, announceCapital=True, flush=False) diff --git a/src/fenrir/commands/commands/review_curr_line.py b/src/fenrir/commands/commands/review_curr_line.py index 489e0a92..fae007a7 100644 --- a/src/fenrir/commands/commands/review_curr_line.py +++ b/src/fenrir/commands/commands/review_curr_line.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'current line' + return _('current line') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() @@ -24,7 +24,7 @@ class command(): line_utils.getCurrentLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['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) def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/review_curr_word.py b/src/fenrir/commands/commands/review_curr_word.py index 6a3b273d..c7367861 100644 --- a/src/fenrir/commands/commands/review_curr_word.py +++ b/src/fenrir/commands/commands/review_curr_word.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'current word.' + return _('current word.') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() @@ -24,14 +24,14 @@ class command(): word_utils.getCurrentWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) if currWord.isspace(): - self.env['runtime']['outputManager'].presentText("blank", interrupt=True, flush=False) + self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) else: self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False) if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') if lineBreak: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): - self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') + self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_curr_word_phonetic.py b/src/fenrir/commands/commands/review_curr_word_phonetic.py index d7547e3b..705a8faa 100644 --- a/src/fenrir/commands/commands/review_curr_word_phonetic.py +++ b/src/fenrir/commands/commands/review_curr_word_phonetic.py @@ -16,7 +16,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'phonetically spells the current word and set review to it' + return _('phonetically spells the current word and set review to it') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() @@ -24,7 +24,7 @@ class command(): word_utils.getCurrentWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) if currWord.isspace(): - self.env['runtime']['outputManager'].presentText("blank", interrupt=True, flush=False) + self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) else: firstSequence = True for c in currWord: @@ -33,9 +33,9 @@ class command(): firstSequence = False if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') if lineBreak: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): - self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') + self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_down.py b/src/fenrir/commands/commands/review_down.py index ba97e348..2d27ce6d 100644 --- a/src/fenrir/commands/commands/review_down.py +++ b/src/fenrir/commands/commands/review_down.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set review cursor to char below the current char and present it.' + return _('set review cursor to char below the current char and present it.') def run(self): cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() @@ -24,6 +24,6 @@ class command(): self.env['runtime']['outputManager'].presentText(downChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_line_begin.py b/src/fenrir/commands/commands/review_line_begin.py index b9629bf2..f0fd6bd6 100644 --- a/src/fenrir/commands/commands/review_line_begin.py +++ b/src/fenrir/commands/commands/review_line_begin.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set review cursor to begin of current line and display the content' + return _('set review cursor to begin of current line and display the content') def run(self): cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() @@ -24,10 +24,10 @@ class command(): char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) if currChar.isspace(): - self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True, flush=False) + self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) else: self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) - self.env['runtime']['outputManager'].presentText("beginning of line", interrupt=False) + self.env['runtime']['outputManager'].presentText(_("beginning of line"), interrupt=False) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_line_end.py b/src/fenrir/commands/commands/review_line_end.py index 18f44cb1..5cf14833 100644 --- a/src/fenrir/commands/commands/review_line_end.py +++ b/src/fenrir/commands/commands/review_line_end.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set review cursor to end of current line and display the content' + return _('set review cursor to end of current line and display the content') def run(self): cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() @@ -24,7 +24,7 @@ class command(): char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) - self.env['runtime']['outputManager'].presentText("end of line", interrupt=False) + self.env['runtime']['outputManager'].presentText(_("end of line"), interrupt=False) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_line_first_char.py b/src/fenrir/commands/commands/review_line_first_char.py index 75135ed1..79f8d45f 100644 --- a/src/fenrir/commands/commands/review_line_first_char.py +++ b/src/fenrir/commands/commands/review_line_first_char.py @@ -16,21 +16,21 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set review cursor to end of current line and display the content' + return _('set review cursor to end of current line and display the content') def run(self): cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() x, y, currLine = \ line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText']) if currLine.isspace(): - self.env['runtime']['outputManager'].presentText("line is empty" ,interrupt=True) + self.env['runtime']['outputManager'].presentText(_("line is empty"), interrupt=True) return self.env['runtime']['cursorManager'].setReviewCursorPosition((len(currLine) - len(currLine.lstrip())), cursorPos['y']) self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \ char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) - self.env['runtime']['outputManager'].presentText("first char in line indent " + str(len(currLine) - len(currLine.lstrip())), interrupt=False) + self.env['runtime']['outputManager'].presentText(_("first char in line indent {0}").format(str(len(currLine) - len(currLine.lstrip()))), interrupt=False) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_line_last_char.py b/src/fenrir/commands/commands/review_line_last_char.py index 309e9d29..bf3f7acb 100644 --- a/src/fenrir/commands/commands/review_line_last_char.py +++ b/src/fenrir/commands/commands/review_line_last_char.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set review cursor to end of current line and display the content' + return _('set review cursor to end of current line and display the content') def run(self): cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() @@ -24,7 +24,7 @@ class command(): char_utils.getLastCharInLine(self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) self.env['runtime']['outputManager'].presentText(lastChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) - self.env['runtime']['outputManager'].presentText("last char in line", interrupt=False) + self.env['runtime']['outputManager'].presentText(_("last char in line"), interrupt=False) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_next_char.py b/src/fenrir/commands/commands/review_next_char.py index 0d5d80df..856cac36 100644 --- a/src/fenrir/commands/commands/review_next_char.py +++ b/src/fenrir/commands/commands/review_next_char.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'moves review to the next character and presents it' + return _('moves review to the next character and presents it') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() @@ -25,9 +25,9 @@ class command(): self.env['runtime']['outputManager'].presentText(nextChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') if lineBreak: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): - self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') + self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_next_char_phonetic.py b/src/fenrir/commands/commands/review_next_char_phonetic.py index 2eb2f2f0..6c989fec 100644 --- a/src/fenrir/commands/commands/review_next_char_phonetic.py +++ b/src/fenrir/commands/commands/review_next_char_phonetic.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'phonetically presents the next character and set review to it' + return _('phonetically presents the next character and set review to it') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() @@ -27,9 +27,9 @@ class command(): self.env['runtime']['outputManager'].presentText(nextChar ,interrupt=True, announceCapital=True, flush=False) if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') if lineBreak: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): - self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') + self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_next_line.py b/src/fenrir/commands/commands/review_next_line.py index eae50dcf..ca2902ed 100644 --- a/src/fenrir/commands/commands/review_next_line.py +++ b/src/fenrir/commands/commands/review_next_line.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'moves review to the next line and presents it' + return _('moves review to the next line and presents it') def run(self): self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview'] @@ -26,11 +26,11 @@ class command(): line_utils.getNextLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) if nextLine.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(nextLine, interrupt=True, flush=False) if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_next_word.py b/src/fenrir/commands/commands/review_next_word.py index bc5503cd..4e149c9f 100644 --- a/src/fenrir/commands/commands/review_next_word.py +++ b/src/fenrir/commands/commands/review_next_word.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'moves review to the next word and presents it' + return _('moves review to the next word and presents it') def run(self): self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview'] @@ -26,14 +26,14 @@ class command(): word_utils.getNextWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) if nextWord.isspace(): - self.env['runtime']['outputManager'].presentText("blank", interrupt=True, flush=False) + self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) else: self.env['runtime']['outputManager'].presentText(nextWord, interrupt=True, flush=False) if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') if lineBreak: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): - self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') + self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_next_word_phonetic.py b/src/fenrir/commands/commands/review_next_word_phonetic.py index 2462b0f2..aa12e557 100644 --- a/src/fenrir/commands/commands/review_next_word_phonetic.py +++ b/src/fenrir/commands/commands/review_next_word_phonetic.py @@ -16,7 +16,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'phonetically spells the current word and set review to it' + return _('phonetically spells the current word and set review to it') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() @@ -24,7 +24,7 @@ class command(): word_utils.getNextWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) if nextWord.isspace(): - self.env['runtime']['outputManager'].presentText("blank", interrupt=True, flush=False) + self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) else: firstSequence = True for c in nextWord: @@ -33,9 +33,9 @@ class command(): firstSequence = False if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') if lineBreak: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): - self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') + self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_prev_char.py b/src/fenrir/commands/commands/review_prev_char.py index dabafd1a..aec891d9 100644 --- a/src/fenrir/commands/commands/review_prev_char.py +++ b/src/fenrir/commands/commands/review_prev_char.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'moves review to the previous character and presents it' + return _('moves review to the previous character and presents it') def run(self): self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview'] @@ -28,9 +28,9 @@ class command(): self.env['runtime']['outputManager'].presentText(prevChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') if lineBreak: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): - self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') + self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_prev_char_phonetic.py b/src/fenrir/commands/commands/review_prev_char_phonetic.py index 9e90192e..4c977932 100644 --- a/src/fenrir/commands/commands/review_prev_char_phonetic.py +++ b/src/fenrir/commands/commands/review_prev_char_phonetic.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'phonetically presents the previous character and set review to it' + return _('phonetically presents the previous character and set review to it') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() @@ -27,9 +27,9 @@ class command(): self.env['runtime']['outputManager'].presentText(prevChar ,interrupt=True, announceCapital=True, flush=False) if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') if lineBreak: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): - self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') + self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_prev_line.py b/src/fenrir/commands/commands/review_prev_line.py index 7129d7bc..8905cab7 100644 --- a/src/fenrir/commands/commands/review_prev_line.py +++ b/src/fenrir/commands/commands/review_prev_line.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'moves review to the previous line and presents it' + return _('moves review to the previous line and presents it') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() @@ -24,12 +24,12 @@ class command(): line_utils.getPrevLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) if prevLine.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(prevLine, interrupt=True, flush=False) if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_prev_word.py b/src/fenrir/commands/commands/review_prev_word.py index b1426d87..3d2920ff 100644 --- a/src/fenrir/commands/commands/review_prev_word.py +++ b/src/fenrir/commands/commands/review_prev_word.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'moves review focus to the previous word and presents it' + return _('moves review focus to the previous word and presents it') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() @@ -24,14 +24,14 @@ class command(): word_utils.getPrevWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) if prevWord.isspace(): - self.env['runtime']['outputManager'].presentText("blank", interrupt=True, flush=False) + self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) else: self.env['runtime']['outputManager'].presentText(prevWord, interrupt=True, flush=False) if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=False, soundIcon='EndOfScreen') if lineBreak: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): - self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') + self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_prev_word_phonetic.py b/src/fenrir/commands/commands/review_prev_word_phonetic.py index 3a0292f8..df22fc3a 100644 --- a/src/fenrir/commands/commands/review_prev_word_phonetic.py +++ b/src/fenrir/commands/commands/review_prev_word_phonetic.py @@ -16,7 +16,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'phonetically spells the current word and set review to it' + return _('phonetically spells the current word and set review to it') def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() @@ -24,7 +24,7 @@ class command(): word_utils.getPrevWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) if prevWord.isspace(): - self.env['runtime']['outputManager'].presentText("blank", interrupt=True, flush=False) + self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) else: firstSequence = True for c in prevWord: @@ -33,9 +33,9 @@ class command(): firstSequence = False if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') if lineBreak: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): - self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') + self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_top.py b/src/fenrir/commands/commands/review_top.py index 940410ba..9831e797 100644 --- a/src/fenrir/commands/commands/review_top.py +++ b/src/fenrir/commands/commands/review_top.py @@ -15,11 +15,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'move review to top of screen' + return _('move review to top of screen') def run(self): self.env['screenData']['newCursorReview'] = {'x':0,'y':0} - self.env['runtime']['outputManager'].presentText("Top", interrupt=True, flush=False) + self.env['runtime']['outputManager'].presentText(_("Top"), interrupt=True, flush=False) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_up.py b/src/fenrir/commands/commands/review_up.py index 063c8135..b92c0b37 100644 --- a/src/fenrir/commands/commands/review_up.py +++ b/src/fenrir/commands/commands/review_up.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set review cursor to the char in the line below and present it' + return _('set review cursor to the char in the line below and present it') def run(self): cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() @@ -24,9 +24,9 @@ class command(): self.env['runtime']['outputManager'].presentText(upChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) if endOfScreen: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): - self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=True, soundIcon='EndOfScreen') + self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') if lineBreak: if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): - self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') + self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/set_bookmark_1.py b/src/fenrir/commands/commands/set_bookmark_1.py index a5582b5c..6a59ec79 100644 --- a/src/fenrir/commands/commands/set_bookmark_1.py +++ b/src/fenrir/commands/commands/set_bookmark_1.py @@ -15,11 +15,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set Bookmark ' + self.ID + return _('set Bookmark {0}').format(self.ID,) def run(self): if not self.env['commandBuffer']['Marks']['1']: - self.env['runtime']['outputManager'].presentText("No Mark found", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("No Mark found"), interrupt=True) return currApp = self.env['runtime']['applicationManager'].getCurrentApplication() self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {} @@ -29,7 +29,7 @@ class command(): self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy() else: self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None - self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " set for application " + currApp, interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True) self.env['commandBuffer']['Marks']['1'] = None self.env['commandBuffer']['Marks']['2'] = None def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/set_bookmark_10.py b/src/fenrir/commands/commands/set_bookmark_10.py index 1e51729a..4a565c2f 100644 --- a/src/fenrir/commands/commands/set_bookmark_10.py +++ b/src/fenrir/commands/commands/set_bookmark_10.py @@ -15,11 +15,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set Bookmark ' + self.ID + return _('set Bookmark {0}').format(self.ID,) def run(self): if not self.env['commandBuffer']['Marks']['1']: - self.env['runtime']['outputManager'].presentText("No Mark found", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("No Mark found"), interrupt=True) return currApp = self.env['runtime']['applicationManager'].getCurrentApplication() self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {} @@ -29,7 +29,7 @@ class command(): self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy() else: self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None - self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " set for application " + currApp, interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True) self.env['commandBuffer']['Marks']['1'] = None self.env['commandBuffer']['Marks']['2'] = None def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/set_bookmark_2.py b/src/fenrir/commands/commands/set_bookmark_2.py index 8087700e..26d02637 100644 --- a/src/fenrir/commands/commands/set_bookmark_2.py +++ b/src/fenrir/commands/commands/set_bookmark_2.py @@ -15,11 +15,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set Bookmark ' + self.ID + return _('set Bookmark {0}').format(self.ID,) def run(self): if not self.env['commandBuffer']['Marks']['1']: - self.env['runtime']['outputManager'].presentText("No Mark found", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("No Mark found"), interrupt=True) return currApp = self.env['runtime']['applicationManager'].getCurrentApplication() self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {} @@ -29,7 +29,7 @@ class command(): self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy() else: self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None - self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " set for application " + currApp, interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True) self.env['commandBuffer']['Marks']['1'] = None self.env['commandBuffer']['Marks']['2'] = None def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/set_bookmark_3.py b/src/fenrir/commands/commands/set_bookmark_3.py index ee00d310..8645ee3c 100644 --- a/src/fenrir/commands/commands/set_bookmark_3.py +++ b/src/fenrir/commands/commands/set_bookmark_3.py @@ -15,11 +15,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set Bookmark ' + self.ID + return _('set Bookmark {0}').format(self.ID,) def run(self): if not self.env['commandBuffer']['Marks']['1']: - self.env['runtime']['outputManager'].presentText("No Mark found", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("No Mark found"), interrupt=True) return currApp = self.env['runtime']['applicationManager'].getCurrentApplication() self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {} @@ -29,7 +29,7 @@ class command(): self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy() else: self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None - self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " set for application " + currApp, interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True) self.env['commandBuffer']['Marks']['1'] = None self.env['commandBuffer']['Marks']['2'] = None def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/set_bookmark_4.py b/src/fenrir/commands/commands/set_bookmark_4.py index b983b418..b098a50d 100644 --- a/src/fenrir/commands/commands/set_bookmark_4.py +++ b/src/fenrir/commands/commands/set_bookmark_4.py @@ -15,11 +15,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set Bookmark ' + self.ID + return _('set Bookmark {0}').format(self.ID,) def run(self): if not self.env['commandBuffer']['Marks']['1']: - self.env['runtime']['outputManager'].presentText("No Mark found", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("No Mark found"), interrupt=True) return currApp = self.env['runtime']['applicationManager'].getCurrentApplication() self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {} @@ -29,7 +29,7 @@ class command(): self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy() else: self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None - self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " set for application " + currApp, interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True) self.env['commandBuffer']['Marks']['1'] = None self.env['commandBuffer']['Marks']['2'] = None def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/set_bookmark_5.py b/src/fenrir/commands/commands/set_bookmark_5.py index 10dbb868..6c082f91 100644 --- a/src/fenrir/commands/commands/set_bookmark_5.py +++ b/src/fenrir/commands/commands/set_bookmark_5.py @@ -15,11 +15,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set Bookmark ' + self.ID + return _('set Bookmark {0}').format(self.ID,) def run(self): if not self.env['commandBuffer']['Marks']['1']: - self.env['runtime']['outputManager'].presentText("No Mark found", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("No Mark found"), interrupt=True) return currApp = self.env['runtime']['applicationManager'].getCurrentApplication() self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {} @@ -29,7 +29,7 @@ class command(): self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy() else: self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None - self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " set for application " + currApp, interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True) self.env['commandBuffer']['Marks']['1'] = None self.env['commandBuffer']['Marks']['2'] = None def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/set_bookmark_6.py b/src/fenrir/commands/commands/set_bookmark_6.py index 43979791..a309d089 100644 --- a/src/fenrir/commands/commands/set_bookmark_6.py +++ b/src/fenrir/commands/commands/set_bookmark_6.py @@ -15,11 +15,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set Bookmark ' + self.ID + return _('set Bookmark {0}').format(self.ID,) def run(self): if not self.env['commandBuffer']['Marks']['1']: - self.env['runtime']['outputManager'].presentText("No Mark found", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("No Mark found"), interrupt=True) return currApp = self.env['runtime']['applicationManager'].getCurrentApplication() self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {} @@ -29,7 +29,7 @@ class command(): self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy() else: self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None - self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " set for application " + currApp, interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True) self.env['commandBuffer']['Marks']['1'] = None self.env['commandBuffer']['Marks']['2'] = None def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/set_bookmark_7.py b/src/fenrir/commands/commands/set_bookmark_7.py index 6fbbcbbc..4803487f 100644 --- a/src/fenrir/commands/commands/set_bookmark_7.py +++ b/src/fenrir/commands/commands/set_bookmark_7.py @@ -15,11 +15,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set Bookmark ' + self.ID + return _('set Bookmark {0}').format(self.ID,) def run(self): if not self.env['commandBuffer']['Marks']['1']: - self.env['runtime']['outputManager'].presentText("No Mark found", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("No Mark found"), interrupt=True) return currApp = self.env['runtime']['applicationManager'].getCurrentApplication() self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {} @@ -29,7 +29,7 @@ class command(): self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy() else: self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None - self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " set for application " + currApp, interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True) self.env['commandBuffer']['Marks']['1'] = None self.env['commandBuffer']['Marks']['2'] = None def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/set_bookmark_8.py b/src/fenrir/commands/commands/set_bookmark_8.py index dd87c7f4..362f61c9 100644 --- a/src/fenrir/commands/commands/set_bookmark_8.py +++ b/src/fenrir/commands/commands/set_bookmark_8.py @@ -15,11 +15,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set Bookmark ' + self.ID + return _('set Bookmark {0}').format(self.ID,) def run(self): if not self.env['commandBuffer']['Marks']['1']: - self.env['runtime']['outputManager'].presentText("No Mark found", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("No Mark found"), interrupt=True) return currApp = self.env['runtime']['applicationManager'].getCurrentApplication() self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {} @@ -29,7 +29,7 @@ class command(): self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy() else: self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None - self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " set for application " + currApp, interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True) self.env['commandBuffer']['Marks']['1'] = None self.env['commandBuffer']['Marks']['2'] = None def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/set_bookmark_9.py b/src/fenrir/commands/commands/set_bookmark_9.py index 5136e375..ef53c390 100644 --- a/src/fenrir/commands/commands/set_bookmark_9.py +++ b/src/fenrir/commands/commands/set_bookmark_9.py @@ -15,11 +15,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set Bookmark ' + self.ID + return _('set Bookmark {0}').format(self.ID,) def run(self): if not self.env['commandBuffer']['Marks']['1']: - self.env['runtime']['outputManager'].presentText("No Mark found", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("No Mark found"), interrupt=True) return currApp = self.env['runtime']['applicationManager'].getCurrentApplication() self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {} @@ -29,7 +29,7 @@ class command(): self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy() else: self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None - self.env['runtime']['outputManager'].presentText('Bookmark ' + self.ID + " set for application " + currApp, interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True) self.env['commandBuffer']['Marks']['1'] = None self.env['commandBuffer']['Marks']['2'] = None def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/set_mark.py b/src/fenrir/commands/commands/set_mark.py index 2c2ddd6b..82e1f90c 100644 --- a/src/fenrir/commands/commands/set_mark.py +++ b/src/fenrir/commands/commands/set_mark.py @@ -14,17 +14,17 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'places marks to select text to copy to the clipboard' + return _('places marks to select text to copy to the clipboard') def run(self): if not self.env['runtime']['cursorManager'].isReviewMode(): - self.env['runtime']['outputManager'].presentText('no review cursor', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('no review cursor'), interrupt=True) return currMark = self.env['runtime']['cursorManager'].setMark() if currMark == 1: - self.env['runtime']['outputManager'].presentText('set mark',soundIcon='PlaceStartMark', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('set mark'), soundIcon='PlaceStartMark', interrupt=True) elif currMark == 2: - self.env['runtime']['outputManager'].presentText('set mark',soundIcon='PlaceEndMark', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('set mark'),soundIcon='PlaceEndMark', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/set_window_application.py b/src/fenrir/commands/commands/set_window_application.py index 61940b31..9413fcd5 100644 --- a/src/fenrir/commands/commands/set_window_application.py +++ b/src/fenrir/commands/commands/set_window_application.py @@ -14,15 +14,15 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set Window Mode, needs 2 marks ' + return _('set Window Mode, needs 2 marks ') def run(self): if self.env['runtime']['cursorManager'].setWindowForApplication(): currApp = self.env['runtime']['applicationManager'].getCurrentApplication() - self.env['runtime']['outputManager'].presentText('Window Mode on for application ' + currApp, interrupt=True) + self.env['runtime']['outputManager'].presentText(_('Window Mode on for application {0}').format(currApp), interrupt=True) self.env['runtime']['cursorManager'].clearMarks() else: - self.env['runtime']['outputManager'].presentText("Set window beginn and end marks", interrupt=True) + self.env['runtime']['outputManager'].presentText(_("Set window begin and end marks"), interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/shut_up.py b/src/fenrir/commands/commands/shut_up.py index f9060aee..aad7226b 100644 --- a/src/fenrir/commands/commands/shut_up.py +++ b/src/fenrir/commands/commands/shut_up.py @@ -14,7 +14,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'interrupts the current presentation' + return _('interrupts the current presentation') def run(self): if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']): return diff --git a/src/fenrir/commands/commands/spell_check.py b/src/fenrir/commands/commands/spell_check.py index 2497c856..f6410569 100644 --- a/src/fenrir/commands/commands/spell_check.py +++ b/src/fenrir/commands/commands/spell_check.py @@ -23,17 +23,17 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'checks the spelling of the current word' + return _('checks the spelling of the current word') def updateSpellLanguage(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 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: @@ -49,8 +49,8 @@ class command(): if not currWord.isspace(): if not self.spellChecker.check(currWord): - self.env['runtime']['outputManager'].presentText('misspelled',soundIcon='mispell', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('misspelled'),soundIcon='mispell', interrupt=True) elif not ignore: - self.env['runtime']['outputManager'].presentText('correct',soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_('correct'),soundIcon='', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/subprocess.py b/src/fenrir/commands/commands/subprocess.py index 411b3de9..3abf4d52 100644 --- a/src/fenrir/commands/commands/subprocess.py +++ b/src/fenrir/commands/commands/subprocess.py @@ -18,16 +18,16 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'script: ' + os.path.basename(self.scriptPath) + ' fullpath: '+ self.scriptPath + return _('script: {0} fullpath: {1}').format(os.path.basename(self.scriptPath), self.scriptPath) def run(self): if not os.path.exists(self.scriptPath): - self.env['runtime']['outputManager'].presentText('scriptfile does not exist' , soundIcon='', interrupt=False) + self.env['runtime']['outputManager'].presentText(_('scriptfile does not exist'), soundIcon='', interrupt=False) return if not os.path.isfile(self.scriptPath): - self.env['runtime']['outputManager'].presentText('scriptfile is not a file' , soundIcon='', interrupt=False) + self.env['runtime']['outputManager'].presentText(_('scriptfile is not a file'), soundIcon='', interrupt=False) return if not os.access(self.scriptPath, os.X_OK): - self.env['runtime']['outputManager'].presentText('scriptfile is not executable' , soundIcon='', interrupt=False) + self.env['runtime']['outputManager'].presentText(_('scriptfile is not executable'), soundIcon='', interrupt=False) return _thread.start_new_thread(self._threadRun , ()) diff --git a/src/fenrir/commands/commands/temp_disable_speech.py b/src/fenrir/commands/commands/temp_disable_speech.py index 9fa577d0..c560e780 100644 --- a/src/fenrir/commands/commands/temp_disable_speech.py +++ b/src/fenrir/commands/commands/temp_disable_speech.py @@ -14,11 +14,11 @@ 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']['settingsManager'].getSettingAsBool('speech', 'enabled'): - self.env['runtime']['outputManager'].presentText("speech temporary disabled", soundIcon='SpeechOff', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("speech temporary disabled"), soundIcon='SpeechOff', interrupt=True) self.env['commandBuffer']['enableSpeechOnKeypress'] = True self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'))) self.env['runtime']['outputManager'].interruptOutput() diff --git a/src/fenrir/commands/commands/time.py b/src/fenrir/commands/commands/time.py index f34e9c04..4c6aa9d8 100644 --- a/src/fenrir/commands/commands/time.py +++ b/src/fenrir/commands/commands/time.py @@ -15,7 +15,7 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'presents the time' + return _('presents the time') def run(self): timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat') diff --git a/src/fenrir/commands/commands/toggle_auto_read.py b/src/fenrir/commands/commands/toggle_auto_read.py index 3090e2b2..d60e9da8 100644 --- a/src/fenrir/commands/commands/toggle_auto_read.py +++ b/src/fenrir/commands/commands/toggle_auto_read.py @@ -13,14 +13,14 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'enables or disables automatic reading of new text as it appears' + return _('enables or disables automatic reading of new text as it appears') def run(self): self.env['runtime']['settingsManager'].setSetting('speech', 'autoReadIncoming', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'))) if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'): - self.env['runtime']['outputManager'].presentText("autoread enabled", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("autoread enabled"), soundIcon='', interrupt=True) else: - self.env['runtime']['outputManager'].presentText("autoread disabled", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("autoread disabled"), soundIcon='', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/toggle_auto_spell_check.py b/src/fenrir/commands/commands/toggle_auto_spell_check.py index 3e6028c3..19d1e06d 100644 --- a/src/fenrir/commands/commands/toggle_auto_spell_check.py +++ b/src/fenrir/commands/commands/toggle_auto_spell_check.py @@ -14,14 +14,14 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'enables or disables automatic spell checking' + return _('enables or disables automatic spell checking') def run(self): self.env['runtime']['settingsManager'].setSetting('general', 'autoSpellCheck', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoSpellCheck'))) if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoSpellCheck'): - self.env['runtime']['outputManager'].presentText("auto spellcheck enabled", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("auto spellcheck enabled"), soundIcon='', interrupt=True) else: - self.env['runtime']['outputManager'].presentText("auto spellcheck disabled", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("auto spellcheck disabled"), soundIcon='', interrupt=True) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/toggle_auto_time.py b/src/fenrir/commands/commands/toggle_auto_time.py index 98f7c5d3..831cca44 100644 --- a/src/fenrir/commands/commands/toggle_auto_time.py +++ b/src/fenrir/commands/commands/toggle_auto_time.py @@ -13,14 +13,14 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'enables or disables automatic reading of time after an period' + return _('enables or disables automatic reading of time after an period') def run(self): self.env['runtime']['settingsManager'].setSetting('time', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'))) if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'): - self.env['runtime']['outputManager'].presentText("autotime enabled", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("autotime enabled"), soundIcon='', interrupt=True) else: - self.env['runtime']['outputManager'].presentText("autotime disabled", soundIcon='', interrupt=True) + self.env['runtime']['outputManager'].presentText(_("autotime disabled"), soundIcon='', interrupt=True) def setCallback(self, callback): pass