Skip to content

Commit

Permalink
Modify NVDA behavior with CLDR characters (#9707)
Browse files Browse the repository at this point in the history
* Modify NVDA behavior with CLDR characters to have them announced everytimes and quicker configurable.
* In the cldr.dic files, set the punctuation level to none
* Add shift+NVDA+p to toggle on and off CLDR characters anouncement
Fix #8826

* User guide: add gesture

* Changes after reviewS.
cldrDict_sconscript:
* Add a comment to specify why punctuation level is set to none
source/globalCommands.py:
* Use script decorator instead of old-style coding
* Fix translators comments
* commented gesture assignment until final advice

* Fix code style for Lint check
One error left: continuation line under-indented for hanging indent
I don't understand how to fix this when I took it from another part of this file

* Code style fix

* Reverted to original code style as codestyle checks now pass

* Delete the commented gesture, will add it back if needed when PR will be reviewed again by @josephsl or someone else

* Remove keyboard shortcut from user guide

* User guide: advise users to assign a command to toggle this feature from everywhere.
  • Loading branch information
Nardol authored and michaelDCurran committed Oct 4, 2019
1 parent b94777e commit 36e608d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cldrDict_sconscript
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def createCLDRAnnotationsDict(sources, dest):
with codecs.open(dest, "w", "utf_8_sig", errors="replace") as dictFile:
dictFile.write(u"symbols:\r\n")
for pattern, description in cldrDict.items():
dictFile.write(u"{pattern}\t{description}\tsome\r\n".format(
# Punctuations are set to none for CLDR characters to be pronounced even if user set punctuation level to None
dictFile.write(u"{pattern}\t{description}\tnone\r\n".format(
pattern=pattern,
description=description
))
Expand Down
17 changes: 17 additions & 0 deletions source/globalCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2282,6 +2282,23 @@ def script_recognizeWithUwpOcr(self, gesture):
# Translators: Describes a command.
script_recognizeWithUwpOcr.__doc__ = _("Recognizes the content of the current navigator object with Windows 10 OCR")

@script(
# Translators: Input help mode message for toggle report CLDR command.
description=_("Toggles on and off the reporting of CLDR characters, such as emojis"),
category=SCRCAT_SPEECH,
)
def script_toggleReportCLDR(self, gesture):
if config.conf["speech"]["includeCLDR"]:
# Translators: presented when the report CLDR is toggled.
state = _("report CLDR characters off")
config.conf["speech"]["includeCLDR"] = False
else:
# Translators: presented when the report CLDR is toggled.
state = _("report CLDR characters on")
config.conf["speech"]["includeCLDR"] = True
characterProcessing.clearSpeechSymbols()
ui.message(state)

@script(
# Translators: Describes a command.
description=_(
Expand Down
2 changes: 2 additions & 0 deletions user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,8 @@ Note that manually added or edited character descriptions are saved as part of y
Therefore, if you change the description of a particular emoji, your custom description will be spoken for that emoji regardless of whether this option is enabled.
You can add, edit or remove symbol descriptions in NVDA's [punctuation/symbol pronunciation dialog #SymbolPronunciation].

To toggle Unicode Consortium data inclusion from anywhere, please assign a custom gesture using the [Input Gestures dialog #InputGestures].

==== Capital pitch change percentage ====[SpeechSettingsCapPitchChange]
This edit field allows you to type the amount that the pitch of the voice will change when speaking a capital letter.
This value is a percentage, where a negative value lowers the pitch and a positive value raises it.
Expand Down

0 comments on commit 36e608d

Please sign in to comment.