From e765bd3a5815b7dd7827787edcf715eeb148642f Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Thu, 16 Jul 2020 18:54:21 -0700 Subject: [PATCH 1/9] Global plugin init: edit Braille Extender submenu entries. Rather than using '%s...', label the submenu items directly. --- addon/globalPlugins/brailleExtender/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addon/globalPlugins/brailleExtender/__init__.py b/addon/globalPlugins/brailleExtender/__init__.py index d6410ddc..390f5f00 100644 --- a/addon/globalPlugins/brailleExtender/__init__.py +++ b/addon/globalPlugins/brailleExtender/__init__.py @@ -258,7 +258,7 @@ def createMenu(self): lambda event: self.script_getHelp(None), item ) - item = self.submenu.Append(wx.ID_ANY, "%s..." % _("&Settings"), _("Opens the addons' settings.")) + item = self.submenu.Append(wx.ID_ANY, _("&Settings..."), _("Opens the addons' settings.")) gui.mainFrame.sysTrayIcon.Bind( wx.EVT_MENU, lambda event: wx.CallAfter(gui.mainFrame._popupSettingsDialog, settings.AddonSettingsDialog), @@ -273,7 +273,7 @@ def createMenu(self): item = dictionariesMenu.Append(wx.ID_ANY, _("Te&mporary dictionary"), _("A dialog where you can set temporary dictionary by adding dictionary entries to the list.")) gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onTemporaryDictionary, item) - item = self.submenu.Append(wx.ID_ANY, "%s..." % _("Advanced &input mode dictionary"), _("Advanced input mode configuration")) + item = self.submenu.Append(wx.ID_ANY, _("Advanced &input mode dictionary..."), _("Advanced input mode configuration")) gui.mainFrame.sysTrayIcon.Bind( wx.EVT_MENU, lambda event: gui.mainFrame._popupSettingsDialog(advancedInputMode.AdvancedInputModeDlg), @@ -291,11 +291,11 @@ def createMenu(self): lambda event: wx.CallAfter(gui.mainFrame._popupSettingsDialog, settings.ProfileEditorDlg), item ) - item = self.submenu.Append(wx.ID_ANY, _("Overview of the current input braille table"), _("Overview of the current input braille table")) + item = self.submenu.Append(wx.ID_ANY, _("Braille input table &overview"), _("Overview of the current input braille table")) gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, lambda event: self.script_getTableOverview(None), item) - item = self.submenu.Append(wx.ID_ANY, _("Reload add-on"), _("Reload this add-on.")) + item = self.submenu.Append(wx.ID_ANY, _("&Reload add-on"), _("Reload this add-on.")) gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onReload, item) - item = self.submenu.Append(wx.ID_ANY, "%s..." % _("&Check for update"), _("Checks if update is available")) + item = self.submenu.Append(wx.ID_ANY, _("Check for &update..."), _("Checks if Braille Extender update is available")) gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onUpdate, item) item = self.submenu.Append(wx.ID_ANY, _("&Website"), _("Open addon's website.")) gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onWebsite, item) From ded9cd803c38bc42d86f95d47d4eed033abee789 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Thu, 16 Jul 2020 18:54:49 -0700 Subject: [PATCH 2/9] Rotor items: headings at level n -> level n headings for conciseness. --- addon/globalPlugins/brailleExtender/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addon/globalPlugins/brailleExtender/__init__.py b/addon/globalPlugins/brailleExtender/__init__.py index 390f5f00..ed2e9019 100644 --- a/addon/globalPlugins/brailleExtender/__init__.py +++ b/addon/globalPlugins/brailleExtender/__init__.py @@ -69,12 +69,12 @@ ("VisitedLink", _("Visited links")), ("Landmark", _("Landmarks")), ("Heading", _("Headings")), - ("Heading1", _("Headings at level 1")), - ("Heading2", _("Headings at level 2")), - ("Heading3", _("Headings at level 3")), - ("Heading4", _("Headings at level 4")), - ("Heading5", _("Headings at level 5")), - ("Heading6", _("Headings at level 6")), + ("Heading1", _("Level 1 headings")), + ("Heading2", _("Level 2 headings")), + ("Heading3", _("Level 3 headings")), + ("Heading4", _("Level 4 headings")), + ("Heading5", _("Level 5 headings")), + ("Heading6", _("Level 6 headings")), ("List", _("Lists")), ("ListItem", _("List items")), ("Graphic", _("Graphics")), From e163b8507edb8d97395d0a48350a34917c372b49 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Thu, 16 Jul 2020 18:55:19 -0700 Subject: [PATCH 3/9] Rotor items: not link text -> non-link text --- addon/globalPlugins/brailleExtender/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/globalPlugins/brailleExtender/__init__.py b/addon/globalPlugins/brailleExtender/__init__.py index ed2e9019..c3d7ee54 100644 --- a/addon/globalPlugins/brailleExtender/__init__.py +++ b/addon/globalPlugins/brailleExtender/__init__.py @@ -85,7 +85,7 @@ ("RadioButton", _("Radio buttons")), ("ComboBox", _("Combo boxes")), ("CheckBox", _("Check boxes")), - ("NotLinkBlock", _("Not link blocks")), + ("NotLinkBlock", _("Non-link blocks")), ("Frame", _("Frames")), ("Separator", _("Separators")), ("EmbeddedObject", _("Embedded objects")), From 65149045eb99d0f1659fb0841d8900693b3624f7 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Thu, 16 Jul 2020 18:56:01 -0700 Subject: [PATCH 4/9] Braille table dictionary: use index-based string format instead of %s for readability. --- addon/globalPlugins/brailleExtender/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/globalPlugins/brailleExtender/__init__.py b/addon/globalPlugins/brailleExtender/__init__.py index c3d7ee54..32bde71c 100644 --- a/addon/globalPlugins/brailleExtender/__init__.py +++ b/addon/globalPlugins/brailleExtender/__init__.py @@ -319,7 +319,7 @@ def onDefaultDictionary(evt): @staticmethod def onTableDictionary(evt): outTable = configBE.tablesTR[configBE.tablesFN.index(config.conf["braille"]["translationTable"])] - gui.mainFrame._popupSettingsDialog(dictionaries.DictionaryDlg, _("Table dictionary")+(" (%s)" % outTable), "table") + gui.mainFrame._popupSettingsDialog(dictionaries.DictionaryDlg, _("Table dictionary ({})").format(outTable), "table") @staticmethod def onTemporaryDictionary(evt): From 3d63273f4d75a9cc3e3325364913bf9787080d55 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Thu, 16 Jul 2020 18:57:40 -0700 Subject: [PATCH 5/9] Braille Extender commands: input help messages edited for conciseness, dedicated 'enabled/disabled' and friends removed. Rather than using messages of the form 'message %s' when toggling settings, just announce the actual toggle message directly to make them conform better with NVDA Core expectations. Various input help messages were edited to fix grammar issues and to make commands clearer. --- .../globalPlugins/brailleExtender/__init__.py | 146 +++++++++--------- 1 file changed, 76 insertions(+), 70 deletions(-) diff --git a/addon/globalPlugins/brailleExtender/__init__.py b/addon/globalPlugins/brailleExtender/__init__.py index 32bde71c..63c977a2 100644 --- a/addon/globalPlugins/brailleExtender/__init__.py +++ b/addon/globalPlugins/brailleExtender/__init__.py @@ -492,10 +492,10 @@ def script_nextEltRotor(self, gesture): if obj.treeInterceptor is not None: obj.treeInterceptor.script_nextError(gesture) else: - ui.message(_("Not supported here or browse mode not enabled")) + ui.message(_("Not supported here or not in browse mode")) else: return self.moveTo("next", gesture) - script_priorRotor.__doc__ = _("Select previous rotor setting") - script_nextRotor.__doc__ = _("Select next rotor setting") + script_priorRotor.__doc__ = _("Switches to the previous rotor setting") + script_nextRotor.__doc__ = _("Switches to the next rotor setting") def script_priorEltRotor(self, gesture): if rotorItems[rotorItem][0] == "default": @@ -514,7 +514,7 @@ def script_priorEltRotor(self, gesture): if obj.treeInterceptor is not None: obj.treeInterceptor.script_previousError(gesture) else: - ui.message(_("Not supported here or browse mode not enabled")) + ui.message(_("Not supported here or not in browse mode")) else: return self.moveTo("previous", gesture) def script_nextSetRotor(self, gesture): @@ -543,54 +543,69 @@ def script_priorSetRotor(self, gesture): self.sendComb('control+alt+uparrow', gesture) else: return self.sendComb('uparrow', gesture) - script_priorEltRotor.__doc__ = _("Move to previous item depending rotor setting") - script_nextEltRotor.__doc__ = _("Move to next item depending rotor setting") + script_priorEltRotor.__doc__ = _("Moves to the previous item based on rotor setting") + script_nextEltRotor.__doc__ = _("Moves to the next item based on rotor setting") def script_selectElt(self, gesture): if rotorItems[rotorItem][0] == "object": return self.sendComb('NVDA+enter', gesture) else: return self.sendComb('enter', gesture) - script_selectElt.__doc__ = _( - 'Varies depending on rotor setting. Eg: in object mode, it\'s similar to NVDA+enter') + script_selectElt.__doc__ = _("Selects the item under the braille cursor e.g. doing default action if moving by objects") - script_priorSetRotor.__doc__ = _( - 'Move to previous item using rotor setting') - script_nextSetRotor.__doc__ = _("Move to next item using rotor setting") + script_priorSetRotor.__doc__ = _("Moves to the previous item based on rotor setting") + script_nextSetRotor.__doc__ = _("Moves to the next item based on rotor setting") def script_toggleLockBrailleKeyboard(self, gesture): self.brailleKeyboardLocked = not self.brailleKeyboardLocked - ui.message(_("Braille keyboard %s") % (_("locked") if self.brailleKeyboardLocked else _("unlocked"))) - script_toggleLockBrailleKeyboard.__doc__ = _("Lock/unlock braille keyboard") + if self.brailleKeyboardLocked: + ui.message(_("Braille keyboard locked")) + else: + ui.message(_("Braille keyboard unlocked")) + script_toggleLockBrailleKeyboard.__doc__ = _("Toggles braille keyboard lock") def script_toggleOneHandMode(self, gesture): config.conf["brailleExtender"]["oneHandedMode"]["enabled"] = not config.conf["brailleExtender"]["oneHandedMode"]["enabled"] - state = _("enabled") if config.conf["brailleExtender"]["oneHandedMode"]["enabled"] else _("disabled") - ui.message(_("One hand mode %s") % state) - script_toggleOneHandMode.__doc__ = _("Enable/disable one hand mode feature") + if config.conf["brailleExtender"]["oneHandedMode"]["enabled"]: + ui.message(_("One-handed mode enabled")) + else: + ui.message(_("One handed mode disabled")) + script_toggleOneHandMode.__doc__ = _("Toggles one-handed mode") def script_toggleDots78(self, gesture): self.hideDots78 = not self.hideDots78 - speech.speakMessage(_("Dots 7 and 8: %s") % (_("disabled") if self.hideDots78 else _("enabled"))) + if self.hideDots78: + speech.speakMessage(_("Dots 7 and 8 disabled")) + else: + speech.speakMessage(_("Dots 7 and 8 enabled")) utils.refreshBD() - script_toggleDots78.__doc__ = _("Hide/show dots 7 and 8") + script_toggleDots78.__doc__ = _("Toggles showing or hiding dots 7 and 8") def script_toggleBRFMode(self, gesture): self.BRFMode = not self.BRFMode utils.refreshBD() - speech.speakMessage(_("BRF mode: %s") % (_("enabled") if self.BRFMode else _("disabled"))) + if self.BRFMode: + speech.speakMessage(_("BRF mode enabled")) + else: + speech.speakMessage(_("BRF mode disabled")) script_toggleBRFMode.__doc__ = _("Enable/disable BRF mode") def script_toggleLockModifiers(self, gesture): self.modifiersLocked = not self.modifiersLocked - ui.message(_("Modifier keys %s") % (_("locked") if self.modifiersLocked else _("unlocked"))) - script_toggleLockModifiers.__doc__ = _("Lock/unlock modifiers keys") + if self.modifiersLocked: + ui.message(_("Modifier keys locked")) + else: + ui.message(_("Modifier keys unlocked")) + script_toggleLockModifiers.__doc__ = _("Toggles locking modifier keys when using braille input") def script_toggleAttribra(self, gesture): config.conf["brailleExtender"]["features"]["attributes"] = not attribraEnabled() utils.refreshBD() - speech.speakMessage('Attribra %s' % (_("enabled") if attribraEnabled() else _("disabled"))) - script_toggleAttribra.__doc__ = _("Enable/disable Attribra") + if config.conf["brailleExtender"]["features"]["attributes"]: + speech.speakMessage("Attribra enabled") + else: + speech.speakMessage("Attribra disabled") + script_toggleAttribra.__doc__ = _("Toggles Attribra") def script_toggleSpeechScrollFocusMode(self, gesture): choices = configBE.focusOrReviewChoices @@ -600,7 +615,7 @@ def script_toggleSpeechScrollFocusMode(self, gesture): newChoice = list(choices.keys())[newChoiceID] config.conf["brailleExtender"]["speakScroll"] = newChoice ui.message(list(choices.values())[newChoiceID].capitalize()) - script_toggleSpeechScrollFocusMode.__doc__ = _("Quick access to the \"say current line while scrolling in\" option") + script_toggleSpeechScrollFocusMode.__doc__ = _("Toggles between say current line while scrolling options between none, focus mode, review mode, or both") def script_toggleSpeech(self, gesture): if speech.speechMode == 0: @@ -630,7 +645,7 @@ def script_getTableOverview(self, gesture): t = (_(" Input table")+": %s\n"+_("Output table")+": %s\n\n") % (inTable+' (%s)' % (brailleInput.handler.table.fileName), ouTable+' (%s)' % (config.conf["braille"]["translationTable"])) t += utils.getTableOverview() ui.browseableMessage("
%s
" % t, _("Table overview (%s)" % brailleInput.handler.table.displayName), True) - script_getTableOverview.__doc__ = _("Display an overview of current input braille table") + script_getTableOverview.__doc__ = _("Shows an overview of current input braille table in a browseable message") def script_translateInBRU(self, gesture): tm = time.time() @@ -657,20 +672,24 @@ def script_cellDescriptionsToChars(self, gesture): def script_advancedInput(self, gesture): self.advancedInput = not self.advancedInput - states = [_("disabled"), _("enabled")] - speech.speakMessage(_("Advanced braille input mode %s") % states[int(self.advancedInput)]) - script_advancedInput.__doc__ = _("Enable/disable the advanced input mode") + if self.advancedInput: + speech.speakMessage(_("Advanced braille input mode enabled")) + else: + speech.speakMessage(_("Advanced braille input mode disabled")) + script_advancedInput.__doc__ = _("Toggles advanced input mode") def script_undefinedCharsDesc(self, gesture): config.conf["brailleExtender"]["undefinedCharsRepr"]["desc"] = not config.conf["brailleExtender"]["undefinedCharsRepr"]["desc"] - states = [_("disabled"), _("enabled")] - speech.speakMessage(_("Description of undefined characters %s") % states[int(config.conf["brailleExtender"]["undefinedCharsRepr"]["desc"])]) + if config.conf["brailleExtender"]["undefinedCharsRepr"]["desc"]: + speech.speakMessage(_("Describe undefined characters enabled")) + else: + speech.speakMessage(_("Describe undefined characters disabled")) utils.refreshBD() - script_undefinedCharsDesc.__doc__ = _("Enable/disable description of undefined characters") + script_undefinedCharsDesc.__doc__ = _("Toggles description of undefined characters") def script_position(self, gesture=None): return ui.message('{0}% ({1}/{2})'.format(round(utils.getPositionPercentage(), 2), utils.getPosition()[0], utils.getPosition()[1])) - script_position.__doc__ = _("Get the cursor position of text") + script_position.__doc__ = _("Reports the cursor position of text under the braille cursor") def script_hourDate(self, gesture=None): if self.autoScrollRunning: @@ -695,8 +714,7 @@ def script_hourDate(self, gesture=None): return self.hourDatePlayed = not self.hourDatePlayed return - - script_hourDate.__doc__ = _("Hour and date with autorefresh") + script_hourDate.__doc__ = _("Shows hour and date changes automatically on a braille display") @staticmethod def showHourDate(): @@ -721,7 +739,7 @@ def script_autoScroll(self, gesture, sil=False): self.backupShowCursor = config.conf["braille"]["showCursor"] config.conf["braille"]["showCursor"] = False self.autoScrollRunning = not self.autoScrollRunning - script_autoScroll.__doc__ = _("Enable/disable autoscroll") + script_autoScroll.__doc__ = _("Toggles automatic braille scroll") def autoScroll(self): braille.handler.scrollForward() @@ -736,7 +754,7 @@ def script_volumePlus(s, g): if config.conf["brailleExtender"]["volumeChangeFeedback"] in [configBE.CHOICE_speech, configBE.CHOICE_speechAndBraille]: speech.speakMessage(str(utils.getVolume())) return - script_volumePlus.__doc__ = _("Increase the master volume") + script_volumePlus.__doc__ = _("Increases the master volume") @staticmethod def clearMessageFlash(): @@ -753,7 +771,7 @@ def script_volumeMinus(s, g): if config.conf["brailleExtender"]["volumeChangeFeedback"] in [configBE.CHOICE_speech, configBE.CHOICE_speechAndBraille]: speech.speakMessage(str(utils.getVolume())) return - script_volumeMinus.__doc__ = _("Decrease the master volume") + script_volumeMinus.__doc__ = _("Decreases the master volume") def script_toggleVolume(s, g): keyboardHandler.KeyboardInputGesture.fromName('volumemute').send() @@ -766,13 +784,12 @@ def script_toggleVolume(s, g): speech.speakMessage(s) if config.conf["brailleExtender"]["volumeChangeFeedback"] in [configBE.CHOICE_braille, configBE.CHOICE_speechAndBraille]: braille.handler.message(s) - - script_toggleVolume.__doc__ = _("Mute or unmute sound") + script_toggleVolume.__doc__ = _("Toggles sound mute") def script_getHelp(self, g): from . import addonDoc addonDoc.AddonDoc(self) - script_getHelp.__doc__ = _("Show the %s documentation") % addonName + script_getHelp.__doc__ = _("Shows the Braille Extender documentation") def noKeyboarLayout(self): return self.noKC @@ -812,14 +829,13 @@ def script_quickLaunch(self, gesture): except BaseException: ui.message(_("No such file or directory")) return - script_quickLaunch.__doc__ = _("Opens a custom program/file. Go to settings to define them") + script_quickLaunch.__doc__ = _("Opens a custom program/file. Go to Braille Extender settings to define them") def script_checkUpdate(self, gesture): if not globalVars.appArgs.secure: checkUpdates() return - - script_checkUpdate.__doc__ = _("Check for %s updates, and starts the download if there is one") % addonName + script_checkUpdate.__doc__ = _("Checks for Braille Extender updates") @staticmethod def increaseDelayAutoScroll(): @@ -848,13 +864,12 @@ def script_decreaseDelayAutoScroll(self, gesture): else: ui.message('%s ms' % config.conf["brailleExtender"]["autoScrollDelay_%s" % configBE.curBD]) return - - script_increaseDelayAutoScroll.__doc__ = _("Increase autoscroll delay") - script_decreaseDelayAutoScroll.__doc__ = _("Decrease autoscroll delay") + script_increaseDelayAutoScroll.__doc__ = _("Increases braille autoscroll delay") + script_decreaseDelayAutoScroll.__doc__ = _("Decreases braille autoscroll delay") def script_switchInputBrailleTable(self, gesture): if configBE.noUnicodeTable: - return ui.message(_("Please use NVDA 2017.3 minimum for this feature")) + return ui.message(_("NVDA 2017.3 or later is required to use this feature")) if len(configBE.inputTables) < 2: return ui.message(_("You must choose at least two tables for this feature. Please fill in the settings")) if not config.conf["braille"]["inputTable"] in configBE.inputTables: @@ -865,14 +880,11 @@ def script_switchInputBrailleTable(self, gesture): )[configBE.tablesFN.index(configBE.inputTables[nID])] ui.message(_("Input: %s") % brailleInput.handler.table.displayName) return - - script_switchInputBrailleTable.__doc__ = _( - "Switch between his favorite input braille tables") + script_switchInputBrailleTable.__doc__ = _("Switches between configured braille input tables") def script_switchOutputBrailleTable(self, gesture): if configBE.noUnicodeTable: - return ui.message( - _("Please use NVDA 2017.3 minimum for this feature")) + return ui.message(_("NVDA 2017.3 or later is required to use this feature")) if len(configBE.outputTables) < 2: return ui.message(_("You must choose at least two tables for this feature. Please fill in the settings")) if not config.conf["braille"]["translationTable"] in configBE.outputTables: @@ -885,8 +897,7 @@ def script_switchOutputBrailleTable(self, gesture): dictionaries.setDictTables() ui.message(_("Output: %s") % configBE.tablesTR[configBE.tablesFN.index(config.conf["braille"]["translationTable"])]) return - - script_switchOutputBrailleTable.__doc__ = _("Switch between his favorite output braille tables") + script_switchOutputBrailleTable.__doc__ = _("Switches between configured braille input tables") def script_currentBrailleTable(self, gesture): inTable = brailleInput.handler.table.displayName @@ -898,22 +909,17 @@ def script_currentBrailleTable(self, gesture): braille.handler.message(_("I:{I} ⣿ O: {O}").format(I=inTable, O=ouTable)) speech.speakMessage(_("Input: {I}; Output: {O}").format(I=inTable, O=ouTable)) return - - script_currentBrailleTable.__doc__ = _( - "Announce the current input and output braille tables") + script_currentBrailleTable.__doc__ = _("Reports the current braille input and output tables") def script_brlDescChar(self, gesture): utils.currentCharDesc() - script_brlDescChar.__doc__ = _( - "Gives the Unicode value of the " - "character where the cursor is located " - "and the decimal, binary and octal equivalent.") + script_brlDescChar.__doc__ = _("Reports the Unicode value of the character where the cursor is located and the decimal, binary and octal values") def script_getSpeechOutput(self, gesture): out = utils.getSpeechSymbols() if scriptHandler.getLastScriptRepeatCount() == 0: braille.handler.message(out) else: ui.browseableMessage(out) - script_getSpeechOutput.__doc__ = _("Show the output speech for selected text in braille. Useful for emojis for example") + HLP_browseModeInfo + script_getSpeechOutput.__doc__ = _("Shows the output speech for selected text in braille, useful for emojis for example") + HLP_browseModeInfo def script_repeatLastShortcut(self, gesture): if not self.lastShortcutPerformed: @@ -921,7 +927,7 @@ def script_repeatLastShortcut(self, gesture): return sht = self.lastShortcutPerformed inputCore.manager.emulateGesture(keyboardHandler.KeyboardInputGesture.fromName(sht)) - script_repeatLastShortcut.__doc__ = _("Repeat the last shortcut performed from a braille display") + script_repeatLastShortcut.__doc__ = _("Repeats the last shortcut performed from a braille display") def onReload(self, evt=None, sil=False, sv=False): self.clearGestureBindings() @@ -935,7 +941,7 @@ def onReload(self, evt=None, sil=False, sv=False): self.gesturesInit() if config.conf["brailleExtender"]["reverseScrollBtns"]: self.reverseScrollBtns() - if not sil: ui.message(_("%s reloaded") % addonName) + if not sil: ui.message(_("Braille Extender reloaded")) return @staticmethod @@ -952,13 +958,13 @@ def on_pot_file(evt): def script_reloadAddon(self, gesture): self.onReload() - script_reloadAddon.__doc__ = _("Reload %s") % addonName + script_reloadAddon.__doc__ = _("Reloads Braille Extender") def script_reload_brailledisplay1(self, gesture): self.reload_brailledisplay(1) - script_reload_brailledisplay1.__doc__ = _("Reload the first braille display defined in settings") + script_reload_brailledisplay1.__doc__ = _("Reloads the primary braille display defined in settings") def script_reload_brailledisplay2(self, gesture): self.reload_brailledisplay(2) - script_reload_brailledisplay2.__doc__ = _("Reload the second braille display defined in settings") + script_reload_brailledisplay2.__doc__ = _("Reloads the secondary braille display defined in settings") def reload_brailledisplay(self, n): k = "brailleDisplay%s" % (2 if n == 2 else 1) @@ -1175,14 +1181,14 @@ def script_saveCurrentBrailleView(self, gesture): else: config.conf["brailleExtender"]["viewSaved"] = configBE.NOVIEWSAVED ui.message(_("Buffer cleaned")) - script_saveCurrentBrailleView.__doc__ = _("Save the current braille view. Press twice quickly to clean the buffer") + script_saveCurrentBrailleView.__doc__ = _("Saves the current braille view. Press twice quickly to clean the buffer") def script_showBrailleViewSaved(self, gesture): if config.conf["brailleExtender"]["viewSaved"] != configBE.NOVIEWSAVED: if scriptHandler.getLastScriptRepeatCount() == 0: braille.handler.message("⣇ %s ⣸" % config.conf["brailleExtender"]["viewSaved"]) else: ui.browseableMessage(config.conf["brailleExtender"]["viewSaved"], _("View saved"), True) else: ui.message(_("Buffer empty")) - script_showBrailleViewSaved.__doc__ = _("Show the saved braille view through a flash message") + HLP_browseModeInfo + script_showBrailleViewSaved.__doc__ = _("Shows the saved braille view through a flash message") + HLP_browseModeInfo # section autoTest autoTestPlayed = False @@ -1293,7 +1299,7 @@ def script_autoTest(self, gesture): def script_addDictionaryEntry(self, gesture): curChar = utils.getCurrentChar() gui.mainFrame._popupSettingsDialog(dictionaries.DictionaryEntryDlg, title=_("Add dictionary entry or see a dictionary"), textPattern=curChar, specifyDict=True) - script_addDictionaryEntry.__doc__ = _("Add a entry in braille dictionary") + script_addDictionaryEntry.__doc__ = _("Adds an entry in braille dictionary") __gestures = OrderedDict() __gestures["kb:NVDA+control+shift+a"] = "logFieldsAtCursor" From cb00a1e0394b611f78539b5202d3e7aea32fae1c Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Fri, 17 Jul 2020 11:38:39 -0700 Subject: [PATCH 6/9] Braille Extender settings: edited UI messages for conciseness and combined separate strings in various options, along with fixing spelling and grammar issues. --- .../brailleExtender/oneHandMode.py | 4 +- .../globalPlugins/brailleExtender/settings.py | 130 +++++++++--------- .../brailleExtender/undefinedChars.py | 9 +- 3 files changed, 71 insertions(+), 72 deletions(-) diff --git a/addon/globalPlugins/brailleExtender/oneHandMode.py b/addon/globalPlugins/brailleExtender/oneHandMode.py index 5b60b1fb..bc73bba7 100644 --- a/addon/globalPlugins/brailleExtender/oneHandMode.py +++ b/addon/globalPlugins/brailleExtender/oneHandMode.py @@ -93,11 +93,11 @@ def process(self, dots): class SettingsDlg(gui.settingsDialogs.SettingsPanel): # Translators: title of a dialog. - title = _("One-hand mode") + title = _("One-handed mode") def makeSettings(self, settingsSizer): sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) - self.featureEnabled = sHelper.addItem(wx.CheckBox(self, label=_("&Enable this feature"))) + self.featureEnabled = sHelper.addItem(wx.CheckBox(self, label=_("Enable &one-handed mode"))) self.featureEnabled.SetValue(config.conf["brailleExtender"]["oneHandedMode"]["enabled"]) self.featureEnabled.Bind(wx.EVT_CHECKBOX, self.onFeatureEnabled) choices = list(INPUT_METHODS.values()) diff --git a/addon/globalPlugins/brailleExtender/settings.py b/addon/globalPlugins/brailleExtender/settings.py index 6841a3f3..ece83547 100644 --- a/addon/globalPlugins/brailleExtender/settings.py +++ b/addon/globalPlugins/brailleExtender/settings.py @@ -33,7 +33,7 @@ addonSettingsDialogWindowHandle = None def notImplemented(msg='', style=wx.OK|wx.ICON_INFORMATION): - if not msg: msg = _("The feature implementation is in progress. Thanks for your patience.") + if not msg: msg = _("Feature implementation is in progress. Thanks for your patience.") gui.messageBox(msg, _("Braille Extender"), wx.OK|wx.ICON_INFORMATION) class GeneralDlg(gui.settingsDialogs.SettingsPanel): @@ -46,44 +46,44 @@ class GeneralDlg(gui.settingsDialogs.SettingsPanel): def makeSettings(self, settingsSizer): sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) # Translators: label of a dialog. - self.autoCheckUpdate = sHelper.addItem(wx.CheckBox(self, label=_("Check for &updates automatically"))) + self.autoCheckUpdate = sHelper.addItem(wx.CheckBox(self, label=_("&Automatically check for Braille Extender updates"))) self.autoCheckUpdate.SetValue(config.conf["brailleExtender"]["autoCheckUpdate"]) # Translators: label of a dialog. - self.updateChannel = sHelper.addLabeledControl(_("Add-on update channel"), wx.Choice, choices=list(configBE.updateChannels.values())) + self.updateChannel = sHelper.addLabeledControl(_("Add-on &update channel:"), wx.Choice, choices=list(configBE.updateChannels.values())) if config.conf["brailleExtender"]["updateChannel"] in configBE.updateChannels.keys(): itemToSelect = list(configBE.updateChannels.keys()).index(config.conf["brailleExtender"]["updateChannel"]) else: itemToSelect = list(config.conf["brailleExtender"]["updateChannel"]).index(configBE.CHANNEL_stable) self.updateChannel.SetSelection(itemToSelect) # Translators: label of a dialog. - self.speakScroll = sHelper.addLabeledControl(_("Say current line while scrolling in"), wx.Choice, choices=list(configBE.focusOrReviewChoices.values())) + self.speakScroll = sHelper.addLabeledControl(_("Say current line while &scrolling in:"), wx.Choice, choices=list(configBE.focusOrReviewChoices.values())) self.speakScroll.SetSelection(list(configBE.focusOrReviewChoices.keys()).index(config.conf["brailleExtender"]["speakScroll"])) # Translators: label of a dialog. - self.stopSpeechScroll = sHelper.addItem(wx.CheckBox(self, label=_("Speech interrupt when scrolling on same line"))) + self.stopSpeechScroll = sHelper.addItem(wx.CheckBox(self, label=_("Speech &interrupt when scrolling on same line"))) self.stopSpeechScroll.SetValue(config.conf["brailleExtender"]["stopSpeechScroll"]) # Translators: label of a dialog. - self.stopSpeechUnknown = sHelper.addItem(wx.CheckBox(self, label=_("Speech interrupt for unknown gestures"))) + self.stopSpeechUnknown = sHelper.addItem(wx.CheckBox(self, label=_("Speech i&nterrupt for unknown gestures"))) self.stopSpeechUnknown.SetValue(config.conf["brailleExtender"]["stopSpeechUnknown"]) # Translators: label of a dialog. - self.speakRoutingTo = sHelper.addItem(wx.CheckBox(self, label=_("Announce the character while moving with routing buttons"))) + self.speakRoutingTo = sHelper.addItem(wx.CheckBox(self, label=_("Announce character when &routing braille cursor"))) self.speakRoutingTo.SetValue(config.conf["brailleExtender"]["speakRoutingTo"]) # Translators: label of a dialog. - self.routingReviewModeWithCursorKeys = sHelper.addItem(wx.CheckBox(self, label=_("Use cursor keys to route cursor in review mode"))) + self.routingReviewModeWithCursorKeys = sHelper.addItem(wx.CheckBox(self, label=_("&Use cursor keys to route cursor in review mode"))) self.routingReviewModeWithCursorKeys.SetValue(config.conf["brailleExtender"]["routingReviewModeWithCursorKeys"]) # Translators: label of a dialog. - self.hourDynamic = sHelper.addItem(wx.CheckBox(self, label=_("Display time and date infinitely"))) + self.hourDynamic = sHelper.addItem(wx.CheckBox(self, label=_("&Display time and date infinitely"))) self.hourDynamic.SetValue(config.conf["brailleExtender"]["hourDynamic"]) - self.reviewModeTerminal = sHelper.addItem(wx.CheckBox(self, label=_("Automatic review mode for apps with terminal")+" (cmd, bash, PuTTY, PowerShell Maxima…)")) + self.reviewModeTerminal = sHelper.addItem(wx.CheckBox(self, label=_("Automatically Switch to review mode in &terminal windows (cmd, bash, PuTTY, PowerShell Maxima…)"))) self.reviewModeTerminal.SetValue(config.conf["brailleExtender"]["reviewModeTerminal"]) # Translators: label of a dialog. - self.volumeChangeFeedback = sHelper.addLabeledControl(_("Feedback for volume change in"), wx.Choice, choices=list(configBE.outputMessage.values())) + self.volumeChangeFeedback = sHelper.addLabeledControl(_("Announce &volume changes:"), wx.Choice, choices=list(configBE.outputMessage.values())) if config.conf["brailleExtender"]["volumeChangeFeedback"] in configBE.outputMessage: itemToSelect = list(configBE.outputMessage.keys()).index(config.conf["brailleExtender"]["volumeChangeFeedback"]) else: @@ -91,33 +91,33 @@ def makeSettings(self, settingsSizer): self.volumeChangeFeedback.SetSelection(itemToSelect) # Translators: label of a dialog. - self.modifierKeysFeedback = sHelper.addLabeledControl(_("Feedback for modifier keys in"), wx.Choice, choices=list(configBE.outputMessage.values())) + self.modifierKeysFeedback = sHelper.addLabeledControl(_("Announce m&odifier key presses:"), wx.Choice, choices=list(configBE.outputMessage.values())) if config.conf["brailleExtender"]["modifierKeysFeedback"] in configBE.outputMessage: itemToSelect = list(configBE.outputMessage.keys()).index(config.conf["brailleExtender"]["modifierKeysFeedback"]) else: itemToSelect = list(configBE.outputMessage.keys()).index(configBE.CHOICE_braille) # Translators: label of a dialog. - self.beepsModifiers = sHelper.addItem(wx.CheckBox(self, label=_("Play beeps for modifier keys"))) + self.beepsModifiers = sHelper.addItem(wx.CheckBox(self, label=_("Play &beeps for modifier keys"))) self.beepsModifiers.SetValue(config.conf["brailleExtender"]["beepsModifiers"]) # Translators: label of a dialog. self.modifierKeysFeedback.SetSelection(itemToSelect) - self.rightMarginCells = sHelper.addLabeledControl(_("Right margin on cells")+" "+_("for the currrent braille display"), gui.nvdaControls.SelectOnFocusSpinCtrl, min=0, max=100, initial=int(config.conf["brailleExtender"]["rightMarginCells_%s" % configBE.curBD])) + self.rightMarginCells = sHelper.addLabeledControl(_("&Right margin on cells for the active braille display"), gui.nvdaControls.SelectOnFocusSpinCtrl, min=0, max=100, initial=int(config.conf["brailleExtender"]["rightMarginCells_%s" % configBE.curBD])) if configBE.gesturesFileExists: lb = [k for k in instanceGP.getKeyboardLayouts()] # Translators: label of a dialog. - self.KBMode = sHelper.addLabeledControl(_("Braille keyboard configuration"), wx.Choice, choices=lb) + self.KBMode = sHelper.addLabeledControl(_("Braille &keyboard configuration:"), wx.Choice, choices=lb) self.KBMode.SetSelection(configBE.getKeyboardLayout()) # Translators: label of a dialog. - self.reverseScrollBtns = sHelper.addItem(wx.CheckBox(self, label=_("Reverse forward scroll and back scroll buttons"))) + self.reverseScrollBtns = sHelper.addItem(wx.CheckBox(self, label=_("&Reverse forward and back scroll buttons"))) self.reverseScrollBtns.SetValue(config.conf["brailleExtender"]["reverseScrollBtns"]) # Translators: label of a dialog. - self.autoScrollDelay = sHelper.addLabeledControl(_("Autoscroll delay (ms)")+" "+_("for the currrent braille display"), gui.nvdaControls.SelectOnFocusSpinCtrl, min=125, max=42000, initial=int(config.conf["brailleExtender"]["autoScrollDelay_%s" % configBE.curBD])) - self.brailleDisplay1 = sHelper.addLabeledControl(_("First braille display preferred"), wx.Choice, choices=self.bds_v) + self.autoScrollDelay = sHelper.addLabeledControl(_("Autoscroll &delay for the active braille display (ms):"), gui.nvdaControls.SelectOnFocusSpinCtrl, min=125, max=42000, initial=int(config.conf["brailleExtender"]["autoScrollDelay_%s" % configBE.curBD])) + self.brailleDisplay1 = sHelper.addLabeledControl(_("Preferred &primary braille display:"), wx.Choice, choices=self.bds_v) self.brailleDisplay1.SetSelection(self.bds_k.index(config.conf["brailleExtender"]["brailleDisplay1"])) - self.brailleDisplay2 = sHelper.addLabeledControl(_("Second braille display preferred"), wx.Choice, choices=self.bds_v) + self.brailleDisplay2 = sHelper.addLabeledControl(_("Preferred &secondary braille display:"), wx.Choice, choices=self.bds_v) self.brailleDisplay2.SetSelection(self.bds_k.index(config.conf["brailleExtender"]["brailleDisplay2"])) def postInit(self): self.autoCheckUpdate.SetFocus() @@ -154,23 +154,23 @@ class AttribraDlg(gui.settingsDialogs.SettingsPanel): def makeSettings(self, settingsSizer): sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) - self.toggleAttribra = sHelper.addItem(wx.CheckBox(self, label=_("&Enable this feature"))) + self.toggleAttribra = sHelper.addItem(wx.CheckBox(self, label=_("Indicate text attributes in braille with &Attribra"))) self.toggleAttribra.SetValue(config.conf["brailleExtender"]["features"]["attributes"]) - self.selectedElement = sHelper.addLabeledControl(_("Show selected elements with"), wx.Choice, choices=configBE.attributeChoicesValues) + self.selectedElement = sHelper.addLabeledControl(_("&Selected elements:"), wx.Choice, choices=configBE.attributeChoicesValues) self.selectedElement.SetSelection(self.getItemToSelect("selectedElement")) - self.spellingErrorsAttribute = sHelper.addLabeledControl(_("Show spelling errors with"), wx.Choice, choices=configBE.attributeChoicesValues) + self.spellingErrorsAttribute = sHelper.addLabeledControl(_("Spelling &errors:"), wx.Choice, choices=configBE.attributeChoicesValues) self.spellingErrorsAttribute.SetSelection(self.getItemToSelect("invalid-spelling")) - self.boldAttribute = sHelper.addLabeledControl(_("Show bold with"), wx.Choice, choices=configBE.attributeChoicesValues) + self.boldAttribute = sHelper.addLabeledControl(_("&Bold:"), wx.Choice, choices=configBE.attributeChoicesValues) self.boldAttribute.SetSelection(self.getItemToSelect("bold")) - self.italicAttribute = sHelper.addLabeledControl(_("Show italic with"), wx.Choice, choices=configBE.attributeChoicesValues) + self.italicAttribute = sHelper.addLabeledControl(_("&Italic:"), wx.Choice, choices=configBE.attributeChoicesValues) self.italicAttribute.SetSelection(self.getItemToSelect("italic")) - self.underlineAttribute = sHelper.addLabeledControl(_("Show underline with"), wx.Choice, choices=configBE.attributeChoicesValues) + self.underlineAttribute = sHelper.addLabeledControl(_("&Underline:"), wx.Choice, choices=configBE.attributeChoicesValues) self.underlineAttribute.SetSelection(self.getItemToSelect("underline")) - self.strikethroughAttribute = sHelper.addLabeledControl(_("Show strikethrough with"), wx.Choice, choices=configBE.attributeChoicesValues) + self.strikethroughAttribute = sHelper.addLabeledControl(_("Strike&through:"), wx.Choice, choices=configBE.attributeChoicesValues) self.strikethroughAttribute.SetSelection(self.getItemToSelect("strikethrough")) - self.subAttribute = sHelper.addLabeledControl(_("Show subscript with"), wx.Choice, choices=configBE.attributeChoicesValues) + self.subAttribute = sHelper.addLabeledControl(_("Su&bscripts:"), wx.Choice, choices=configBE.attributeChoicesValues) self.subAttribute.SetSelection(self.getItemToSelect("text-position:sub")) - self.superAttribute = sHelper.addLabeledControl(_("Show superscript with"), wx.Choice, choices=configBE.attributeChoicesValues) + self.superAttribute = sHelper.addLabeledControl(_("Su&perscripts:"), wx.Choice, choices=configBE.attributeChoicesValues) self.superAttribute.SetSelection(self.getItemToSelect("text-position:super")) def postInit(self): self.toggleAttribra.SetFocus() @@ -204,21 +204,21 @@ class RoleLabelsDlg(gui.settingsDialogs.SettingsPanel): def makeSettings(self, settingsSizer): self.roleLabels = config.conf["brailleExtender"]["roleLabels"].copy() sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) - self.toggleRoleLabels = sHelper.addItem(wx.CheckBox(self, label=_("&Enable this feature"))) + self.toggleRoleLabels = sHelper.addItem(wx.CheckBox(self, label=_("Use custom braille &role labels"))) self.toggleRoleLabels.SetValue(config.conf["brailleExtender"]["features"]["roleLabels"]) - self.categories = sHelper.addLabeledControl(_("Role category"), wx.Choice, choices=[_("General"), _("Landmark"), _("Positive state"), _("Negative state")]) + self.categories = sHelper.addLabeledControl(_("Role &category:"), wx.Choice, choices=[_("General"), _("Landmark"), _("Positive state"), _("Negative state")]) self.categories.Bind(wx.EVT_CHOICE, self.onCategories) self.categories.SetSelection(0) sHelper2 = gui.guiHelper.BoxSizerHelper(self, orientation=wx.HORIZONTAL) - self.labels = sHelper2.addLabeledControl(_("Role"), wx.Choice, choices=[controlTypes.roleLabels[int(k)] for k in braille.roleLabels.keys()]) + self.labels = sHelper2.addLabeledControl(_("&Role:"), wx.Choice, choices=[controlTypes.roleLabels[int(k)] for k in braille.roleLabels.keys()]) self.labels.Bind(wx.EVT_CHOICE, self.onLabels) - self.label = sHelper2.addLabeledControl(_("Actual or new label"), wx.TextCtrl) + self.label = sHelper2.addLabeledControl(_("Braille &label"), wx.TextCtrl) self.label.Bind(wx.EVT_TEXT, self.onLabel) sHelper.addItem(sHelper2) bHelper = gui.guiHelper.ButtonHelper(orientation=wx.HORIZONTAL) - self.resetLabelBtn = bHelper.addButton(self, wx.NewId(), "%s..." % _("&Reset this role label"), wx.DefaultPosition) + self.resetLabelBtn = bHelper.addButton(self, wx.NewId(), _("&Reset this role label"), wx.DefaultPosition) self.resetLabelBtn.Bind(wx.EVT_BUTTON, self.onResetLabelBtn) - self.resetAllLabelsBtn = bHelper.addButton(self, wx.NewId(), "%s..." % _("Reset all role labels"), wx.DefaultPosition) + self.resetAllLabelsBtn = bHelper.addButton(self, wx.NewId(), _("Reset all role labels"), wx.DefaultPosition) self.resetAllLabelsBtn.Bind(wx.EVT_BUTTON, self.onResetAllLabelsBtn) sHelper.addItem(bHelper) self.onCategories(None) @@ -283,11 +283,11 @@ def onResetLabelBtn(self, event): def onResetAllLabelsBtn(self, event): nbCustomizedLabels = len(self.roleLabels) if not nbCustomizedLabels: - queueHandler.queueFunction(queueHandler.eventQueue, ui.message, _("You have no customized label.")) + queueHandler.queueFunction(queueHandler.eventQueue, ui.message, _("You have no customized role labels.")) return res = gui.messageBox( - _("Do you want really reset all labels? Currently, you have %d customized labels.") % nbCustomizedLabels, - _("Confirmation"), + _("You have %d customized role labels defined. Do you want to reset all labels?") % nbCustomizedLabels, + _("Reset role labels"), wx.YES|wx.NO|wx.ICON_INFORMATION) if res == wx.YES: self.roleLabels = {} @@ -343,25 +343,25 @@ def makeSettings(self, settingsSizer): sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) bHelper1 = gui.guiHelper.ButtonHelper(orientation=wx.HORIZONTAL) - self.tables = sHelper.addLabeledControl(_("Prefered braille tables")+" (%s)" % _("press F1 for help"), wx.Choice, choices=self.getTablesWithSwitches()) + self.tables = sHelper.addLabeledControl(_("Prefered braille &tables (press F1 for help):"), wx.Choice, choices=self.getTablesWithSwitches()) self.tables.SetSelection(0) self.tables.Bind(wx.EVT_CHAR, self.onTables) - self.inputTableShortcuts = sHelper.addLabeledControl(_("Input braille table for keyboard shortcut keys"), wx.Choice, choices=lt) + self.inputTableShortcuts = sHelper.addLabeledControl(_("Input braille table for &keyboard shortcut keys:"), wx.Choice, choices=lt) self.inputTableShortcuts.SetSelection(iSht) lt = [_('None')] for table in configBE.tables: if table.output: lt.append(table[1]) - self.postTable = sHelper.addLabeledControl(_("Secondary output table to use"), wx.Choice, choices=lt) + self.postTable = sHelper.addLabeledControl(_("&Secondary output table:"), wx.Choice, choices=lt) self.postTable.SetSelection(configBE.tablesFN.index(config.conf["brailleExtender"]["postTable"]) if config.conf["brailleExtender"]["postTable"] in configBE.tablesFN else 0) # Translators: label of a dialog. - self.tabSpace = sHelper.addItem(wx.CheckBox(self, label=_("Display &tab signs as spaces"))) + self.tabSpace = sHelper.addItem(wx.CheckBox(self, label=_("Display &tabs as spaces"))) self.tabSpace.SetValue(config.conf["brailleExtender"]["tabSpace"]) # Translators: label of a dialog. - self.tabSize = sHelper.addLabeledControl(_("Number of &space for a tab sign")+" "+_("for the currrent braille display"), gui.nvdaControls.SelectOnFocusSpinCtrl, min=1, max=42, initial=int(config.conf["brailleExtender"]["tabSize_%s" % configBE.curBD])) - self.customBrailleTablesBtn = bHelper1.addButton(self, wx.NewId(), "%s..." % _("Alternative and &custom braille tables"), wx.DefaultPosition) + self.tabSize = sHelper.addLabeledControl(_("&Spaces per tab for the active braille display:"), gui.nvdaControls.SelectOnFocusSpinCtrl, min=1, max=42, initial=int(config.conf["brailleExtender"]["tabSize_%s" % configBE.curBD])) + self.customBrailleTablesBtn = bHelper1.addButton(self, wx.NewId(), _("Alternative and &custom braille tables..."), wx.DefaultPosition) self.customBrailleTablesBtn.Bind(wx.EVT_BUTTON, self.onCustomBrailleTablesBtn) sHelper.addItem(bHelper1) @@ -382,7 +382,7 @@ def onSave(self): config.conf["brailleExtender"]["tabSize_%s" % configBE.curBD] = self.tabSize.Value if restartRequired: res = gui.messageBox( - _("NVDA must be restarted for some new options to take effect. Do you want restart now?"), + _("NVDA must be restarted for changes to take effect. Would you like to restart now?"), _("Braille Extender"), style=wx.YES_NO|wx.ICON_INFORMATION ) @@ -460,8 +460,8 @@ def onTables(self, evt): ]), _("About this table"), False) if keycode == wx.WXK_F1: ui.browseableMessage( - _("In this combo box, all tables are present. Press space bar, left or right arrow keys to include (or not) the selected table in switches")+".\n"+ - _("You can also press 'comma' key to get the file name of the selected table and 'semicolon' key to view miscellaneous infos on the selected table")+".", + _("""Braille tables usable from NVDA are listed. Press space, left arrow, or right arrow keys to include (or exclude) the selected table in switches.\n + You can also press 'comma' key to get the file name of the selected table, and 'semicolon' key to view miscellaneous information on the selected table."""), _("Contextual help"), False) if keycode in [wx.WXK_LEFT, wx.WXK_RIGHT, wx.WXK_SPACE]: idx, tbl = self.getCurrentSelection() @@ -488,9 +488,9 @@ def makeSettings(self, settingsSizer): wx.CallAfter(notImplemented) sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) bHelper1 = gui.guiHelper.ButtonHelper(orientation=wx.HORIZONTAL) - self.inTable = sHelper.addItem(wx.CheckBox(self, label=_("Use a custom table as input table"))) - self.outTable = sHelper.addItem(wx.CheckBox(self, label=_("Use a custom table as output table"))) - self.addBrailleTablesBtn = bHelper1.addButton(self, wx.NewId(), "%s..." % _("&Add a braille table"), wx.DefaultPosition) + self.inTable = sHelper.addItem(wx.CheckBox(self, label=_("Use a custom table as &input table"))) + self.outTable = sHelper.addItem(wx.CheckBox(self, label=_("Use a custom table as &output table"))) + self.addBrailleTablesBtn = bHelper1.addButton(self, wx.NewId(), _("&Add a braille table..."), wx.DefaultPosition) self.addBrailleTablesBtn.Bind(wx.EVT_BUTTON, self.onAddBrailleTablesBtn) sHelper.addItem(bHelper1) @@ -520,21 +520,21 @@ class AddBrailleTablesDlg(gui.settingsDialogs.SettingsDialog): def makeSettings(self, settingsSizer): sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) bHelper1 = gui.guiHelper.ButtonHelper(orientation=wx.HORIZONTAL) - self.name = sHelper.addLabeledControl(_("Display name"), wx.TextCtrl) - self.description = sHelper.addLabeledControl(_("Description"), wx.TextCtrl, style = wx.TE_MULTILINE|wx.TE_PROCESS_ENTER, size = (360, 90), pos=(-1,-1)) - self.path = sHelper.addLabeledControl(_("Path"), wx.TextCtrl) - self.browseBtn = bHelper1.addButton(self, wx.NewId(), "%s..." % _("&Browse"), wx.DefaultPosition) + self.name = sHelper.addLabeledControl(_("Display &name"), wx.TextCtrl) + self.description = sHelper.addLabeledControl(_("&Description"), wx.TextCtrl, style = wx.TE_MULTILINE|wx.TE_PROCESS_ENTER, size = (360, 90), pos=(-1,-1)) + self.path = sHelper.addLabeledControl(_("&Path"), wx.TextCtrl) + self.browseBtn = bHelper1.addButton(self, wx.NewId(), _("&Browse..."), wx.DefaultPosition) self.browseBtn.Bind(wx.EVT_BUTTON, self.onBrowseBtn) sHelper.addItem(bHelper1) - self.isContracted = sHelper.addItem(wx.CheckBox(self, label=_("Contracted (grade 2) braille table"))) + self.isContracted = sHelper.addItem(wx.CheckBox(self, label=_("This is a &contracted (grade 2) braille table"))) # Translators: label of a dialog. - self.inputOrOutput = sHelper.addLabeledControl(_("Available for"), wx.Choice, choices=[_("Input and output"), _("Input only"), _("Output only")]) + self.inputOrOutput = sHelper.addLabeledControl(_("&Available for:"), wx.Choice, choices=[_("Input and output"), _("Input only"), _("Output only")]) self.inputOrOutput.SetSelection(0) def postInit(self): self.name.SetFocus() def onBrowseBtn(self, event): - dlg = wx.FileDialog(None, _("Choose a table file"), "%PROGRAMFILES%", "", "%s (*.ctb, *.cti, *.utb, *.uti)|*.ctb;*.cti;*.utb;*.uti" % _("Liblouis table files"), style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) + dlg = wx.FileDialog(None, _("Choose a braille table file"), "%PROGRAMFILES%", "", "%s (*.ctb, *.cti, *.utb, *.uti)|*.ctb;*.cti;*.utb;*.uti" % _("Liblouis table files"), style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) if dlg.ShowModal() != wx.ID_OK: dlg.Destroy() return self.path.SetFocus() @@ -578,7 +578,7 @@ def getAvailableBrailleTables(): class QuickLaunchesDlg(gui.settingsDialogs.SettingsDialog): # Translators: title of a dialog. - title = "Braille Extender - %s" % _("Quick launches") + title = _("Braille Extender - Quick launches") quickLaunchGestures = [] quickLaunchLocations = [] captureEnabled = False @@ -589,12 +589,12 @@ def makeSettings(self, settingsSizer): self.quickLaunchLocations = list(config.conf["brailleExtender"]["quickLaunches"].copy().values()) sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) bHelper1 = gui.guiHelper.ButtonHelper(orientation=wx.HORIZONTAL) - self.quickKeys = sHelper.addLabeledControl(_("&Gestures"), wx.Choice, choices=self.getQuickLaunchList()) + self.quickKeys = sHelper.addLabeledControl(_("&Gestures:"), wx.Choice, choices=self.getQuickLaunchList()) self.quickKeys.SetSelection(0) self.quickKeys.Bind(wx.EVT_CHOICE, self.onQuickKeys) - self.target = sHelper.addLabeledControl(_("Location (file path, URL or command)"), wx.TextCtrl, value=self.quickLaunchLocations[0] if self.quickLaunchLocations != [] else '') + self.target = sHelper.addLabeledControl(_("&Location (file path, URL or command)"), wx.TextCtrl, value=self.quickLaunchLocations[0] if self.quickLaunchLocations != [] else '') self.target.Bind(wx.EVT_TEXT, self.onTarget) - self.browseBtn = bHelper1.addButton(self, wx.NewId(), "%s..." % _("&Browse"), wx.DefaultPosition) + self.browseBtn = bHelper1.addButton(self, wx.NewId(), _("&Browse..."), wx.DefaultPosition) self.removeGestureBtn = bHelper1.addButton(self, wx.NewId(), _("&Remove this gesture"), wx.DefaultPosition) self.addGestureBtn = bHelper1.addButton(self, wx.NewId(), _("&Add a quick launch"), wx.DefaultPosition) self.browseBtn.Bind(wx.EVT_BUTTON, self.onBrowseBtn) @@ -625,7 +625,7 @@ def getCaptured(gesture): queueHandler.queueFunction(queueHandler.eventQueue, gesture.script, gesture) return False elif script is not None: - queueHandler.queueFunction(queueHandler.eventQueue, ui.message, _("Unable to associate this gesture. Please enter another, now")) + queueHandler.queueFunction(queueHandler.eventQueue, ui.message, _("Unable to associate this gesture. Please enter another gesture")) return False elif gesture.isModifier: return False elif gesture.normalizedIdentifiers[0].endswith(":space"): @@ -640,7 +640,7 @@ def getCaptured(gesture): self.quickKeys.SetItems(self.getQuickLaunchList()) self.quickKeys.SetSelection(len(self.quickLaunchGestures)-1) self.onQuickKeys(None) - queueHandler.queueFunction(queueHandler.eventQueue, ui.message, _("OK. The gesture captured is %s") % utils.beautifulSht(gesture.normalizedIdentifiers[0])) + queueHandler.queueFunction(queueHandler.eventQueue, ui.message, _("The gesture captured is %s") % utils.beautifulSht(gesture.normalizedIdentifiers[0])) inputCore.manager._captureFunc = None self.captureEnabled = False self.addGestureBtn.SetLabel(self.captureLabelBtn) @@ -657,7 +657,7 @@ def onRemoveGestureBtn(self, event): self.askCreateQuickLaunch() return def askConfirmation(): - choice = gui.messageBox(_("Are you sure to want to delete this shorcut?"), '%s – %s' % (addonName, _("Confirmation")), wx.YES_NO|wx.ICON_QUESTION) + choice = gui.messageBox(_("Are you sure you wish to delete this shortcut?"), '%s – %s' % (addonName, _("Remove shortcut")), wx.YES_NO|wx.ICON_QUESTION) if choice == wx.YES: confirmed() def confirmed(): i = self.quickKeys.GetSelection() @@ -904,8 +904,8 @@ class AddonSettingsDialog(gui.settingsDialogs.MultiCategorySettingsDialog): ] def __init__(self, parent, initialCategory=None): - # Translators: title of add-on parameters dialog. - self.title = _("{addonSummary} settings").format(addonSummary=addonSummary) + # Translators: title of add-on settings dialog. + self.title = _("Braille Extender settings") super(AddonSettingsDialog,self).__init__(parent, initialCategory) def makeSettings(self, settingsSizer): diff --git a/addon/globalPlugins/brailleExtender/undefinedChars.py b/addon/globalPlugins/brailleExtender/undefinedChars.py index 80c3c6ca..f09d7a6f 100644 --- a/addon/globalPlugins/brailleExtender/undefinedChars.py +++ b/addon/globalPlugins/brailleExtender/undefinedChars.py @@ -41,14 +41,14 @@ signPatternSample = "??" CHOICES_LABELS = { - CHOICE_tableBehaviour: _("Use braille table behavior") + " (%s)" % _("no description possible"), + CHOICE_tableBehaviour: _("Use braille table behavior (no description possible)"), CHOICE_allDots8: _("Dots 1-8 (⣿)"), CHOICE_allDots6: _("Dots 1-6 (⠿)"), CHOICE_emptyCell: _("Empty cell (⠀)"), CHOICE_otherDots: _("Other dot pattern (e.g.: {dotPatternSample})").format( dotPatternSample=dotPatternSample ), - CHOICE_questionMark: _("Question mark (depending output table)"), + CHOICE_questionMark: _("Question mark (depending on output table)"), CHOICE_otherSign: _("Other sign/pattern (e.g.: {signPatternSample})").format( signPatternSample=signPatternSample ), @@ -239,7 +239,7 @@ def undefinedCharProcess(self): class SettingsDlg(gui.settingsDialogs.SettingsPanel): # Translators: title of a dialog. - title = _("Representation of undefined characters") + title = _("Undefined character representation") def makeSettings(self, settingsSizer): sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer) @@ -259,8 +259,7 @@ def makeSettings(self, settingsSizer): ) self.undefinedCharDesc = sHelper.addItem( wx.CheckBox(self, label=( - _("Show punctuation/symbol &name for undefined characters if available") - + " (%s)" % _("can cause a lag") + _("Show punctuation/symbol &name for undefined characters if available (can cause a lag)") )) ) self.undefinedCharDesc.SetValue( From be7910c43c7c88b828c11e7d9ef4a4073ef9bbbc Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Fri, 17 Jul 2020 11:39:06 -0700 Subject: [PATCH 7/9] Braille Extender dictionaries: UI message edits. --- addon/globalPlugins/brailleExtender/dictionaries.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addon/globalPlugins/brailleExtender/dictionaries.py b/addon/globalPlugins/brailleExtender/dictionaries.py index 9d34c00f..7d974865 100644 --- a/addon/globalPlugins/brailleExtender/dictionaries.py +++ b/addon/globalPlugins/brailleExtender/dictionaries.py @@ -106,7 +106,7 @@ def notifyInvalidTables(): getPathDict("table"): "table", getPathDict("tmp"): "tmp" } - msg = _("One or more errors are present in dictionaries tables. Concerned dictionaries: %s. As a result, these dictionaries are not loaded.") % ", ".join([dicts[path] for path in invalidDictTables if path in dicts]) + msg = _("One or more errors are present in dictionary tables: %s. As a result, these dictionaries were not loaded.") % ", ".join([dicts[path] for path in invalidDictTables if path in dicts]) wx.CallAfter(gui.messageBox, msg, _("Braille Extender"), wx.OK|wx.ICON_ERROR) def removeTmpDict(): @@ -293,7 +293,7 @@ def __init__(self, parent=None, title=_("Edit Dictionary Entry"), textPattern='' # Translators: This is a label for an edit field in add dictionary entry dialog. dictText = _("Dictionary") outTable = configBE.tablesTR[configBE.tablesFN.index(config.conf["braille"]["translationTable"])] - dictChoices = [_("Global"), _("Table")+(" (%s)" % outTable), _("Temporary")] + dictChoices = [_("Global"), _("Table ({})").format(outTable), _("Temporary")] self.dictRadioBox = sHelper.addItem(wx.RadioBox(self, label=dictText, choices=dictChoices)) self.dictRadioBox.SetSelection(1) bHelper = gui.guiHelper.ButtonHelper(orientation=wx.HORIZONTAL) @@ -339,7 +339,7 @@ def __init__(self, parent=None, title=_("Edit Dictionary Entry"), textPattern='' def onSeeEntriesClick(self, evt): outTable = configBE.tablesTR[configBE.tablesFN.index(config.conf["braille"]["translationTable"])] - label = [_("Global dictionary"), _("Table dictionary")+(" (%s)" % outTable), _("Temporary dictionary")][self.dictRadioBox.GetSelection()] + label = [_("Global dictionary"), _("Table dictionary ({})").format(outTable), _("Temporary dictionary")][self.dictRadioBox.GetSelection()] type_ = self.getType_() self.Destroy() gui.mainFrame._popupSettingsDialog(DictionaryDlg, label, type_) @@ -374,7 +374,7 @@ def onOk(self, evt): gui.messageBox(msg, _("Braille Extender"), wx.OK|wx.ICON_ERROR) return self.textPatternTextCtrl.SetFocus() if not braillePattern: - msg = _("'Braille representation' field is empty, you must specify something with this opcode. E.g.: %s") % egBRLRepr + msg = _("'Braille representation' field is empty. You must specify something with this opcode. E.g.: %s") % egBRLRepr gui.messageBox(msg, _("Braille Extender"), wx.OK|wx.ICON_ERROR) return self.braillePatternTextCtrl.SetFocus() if not re.match("^[0-8\-]+$", braillePattern): From 5d7cad5a975f135f37245bc237f3ad7fdb8b3552 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Fri, 17 Jul 2020 11:39:22 -0700 Subject: [PATCH 8/9] Braille Extender update check: UI message edits --- addon/globalPlugins/brailleExtender/updateCheck.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addon/globalPlugins/brailleExtender/updateCheck.py b/addon/globalPlugins/brailleExtender/updateCheck.py index 23fa4137..db22a1bf 100644 --- a/addon/globalPlugins/brailleExtender/updateCheck.py +++ b/addon/globalPlugins/brailleExtender/updateCheck.py @@ -53,7 +53,7 @@ def availableUpdateDialog(version = '', msg = ''): global checkInProgress checkInProgress = True res = gui.messageBox( - (_("New version available, version %s. Do you want to download it now?") % version.strip()+('\n%s' % msg)).strip(), + (_("Braille Extender version %s is available. Do you want to download it now?") % version.strip()+('\n%s' % msg)).strip(), title, wx.YES|wx.NO|wx.ICON_INFORMATION) if res == wx.YES: @@ -73,7 +73,7 @@ def errorUpdateDialog(): global checkInProgress checkInProgress = True res = gui.messageBox( - _("Oops! There was a problem downloading for update. Please retry later or download and install manually via %s. Do you want to open this URL in your browser now?") % addonInfos["url"], + _("Oops! There was a problem downloading Braille Extender update. Please retry later or download and install manually from %s. Do you want to open this URL in your browser?") % addonInfos["url"], title, wx.YES|wx.NO|wx.ICON_ERROR) if res == wx.YES: os.startfile(addonInfos["url"]) @@ -108,7 +108,7 @@ def processUpdate(): return wx.CallAfter(errorUpdateDialog) if checkInProgress: return ui.message(_("An update check dialog is already running!")) - title = _("{addonName}'s update").format(addonName=addonInfos["name"]) + title = _("Braille Extender update") newUpdate = False url = addonInfos["url"]; if url.endswith('/'): url = url[0:-1] From 63042d2ac8174bb7405417d03f1250f051f85d2f Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Mon, 20 Jul 2020 01:33:31 -0700 Subject: [PATCH 9/9] BRF mode: enable/disable -> toggles in input help mode message --- addon/globalPlugins/brailleExtender/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/globalPlugins/brailleExtender/__init__.py b/addon/globalPlugins/brailleExtender/__init__.py index d2e53ccf..7c390d31 100644 --- a/addon/globalPlugins/brailleExtender/__init__.py +++ b/addon/globalPlugins/brailleExtender/__init__.py @@ -582,7 +582,7 @@ def script_toggleBRFMode(self, gesture): speech.speakMessage(_("BRF mode enabled")) else: speech.speakMessage(_("BRF mode disabled")) - script_toggleBRFMode.__doc__ = _("Enable/disable BRF mode") + script_toggleBRFMode.__doc__ = _("Toggles BRF mode") def script_toggleLockModifiers(self, gesture): self.modifiersLocked = not self.modifiersLocked