Skip to content

Commit

Permalink
Sound splitter toggle script: add translator comments, rework config …
Browse files Browse the repository at this point in the history
…algorithm.

In addition to translator comments for script description, rework the actual configuration script in order to add translator comments to messages themselves. Specifclaly, each condition will be checked via a master if conditional.
  • Loading branch information
josephsl committed Jan 28, 2022
1 parent a23fdce commit 1920582
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions addon/globalPlugins/soundSplitter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,19 @@ def handleConfigProfileSwitch(self):
def reload(self, factoryDefaults=False):
updateSoundSplitterMonitorThread()

@script(description='Toggle sound split.', gestures=['kb:NVDA+Alt+S'])
@script(
# Translators: input help message for toggle sound splitter command.
description=_("Toggle sound split"),
gesture="kb:NVDA+Alt+S"
)
def script_toggleSoundSplit(self, gesture):
ss = config.conf["soundSplitter"]["soundSplit"]
ss = not ss
msg = _("Sound split enabled") if ss else _("Sound split disabled")
config.conf["soundSplitter"]["soundSplit"] = ss
if config.conf["soundSplitter"]["soundSplit"]:
# Translators: presented when toggling sound splitter.
msg = _("Sound split disabled")
config.conf["soundSplitter"]["soundSplit"] = False
else:
# Translators: presented when toggling sound splitter.
msg = _("Sound split enabled")
config.conf["soundSplitter"]["soundSplit"] = True
updateSoundSplitterMonitorThread()
ui.message(msg)

0 comments on commit 1920582

Please sign in to comment.