Uniformize all "Copied to clipboard" messages (#6757)#9843
Conversation
|
72e9d14: Rebased onto latest master |
|
Rebased onto latest master and linted. |
|
While it is certainly too late to include this into 2019.3 it would be great if it can be considered for the next release. cc @feerrenrut @michaelDCurran |
|
Does this require updates to the user guide? |
|
@feerrenrut wrote:
IMHO it does not @JulienCochuyt Do you agree? I'd be great to push this forward - the change is quite small and in my opinion PR's such as this one i.e cosmetic changes are contributing to the backlog greatly. |
I couldn't find in the user guide any mention of the exact announce performed when text is copied. @lukaszgo1 wrote:
Thanks for your support. |
| # Translators: Announced when a text has been copied to clipboard. | ||
| # %s is replaced by the copied text. | ||
| speech.speakMessage(_("Copied to clipboard: %s" % text)) | ||
| # Translators: Displayed in braille when a text has been copied to clipboard. | ||
| # %s is replaced by the copied text. | ||
| braille.handler.message(_("Copied: %s" % text)) |
There was a problem hiding this comment.
I'd prefer not import speech for this. Instead, I think we should add an optional "brailleMessage" argument to ui.message. That way, the detail for how messaging is done is abstracted away.
Actually, I think this is only place in api.py that uses the ui module. We have long had requests for greater customization of UI messages collecting this UI together will probably help (also with consistency of messages). Perhaps the messages should be moved into the ui module, EG: def reportTextCopiedToClipboard(text: Optional[str]) -> None. When text is None, "Unable to copy" is reported. This can be called from each place that wishes to notify, rather than doing it in api.
Thinking about why these are different, perhaps both speech and braille should simply use "Copied: %s"? It's shorter, and arguably "to clipboard" doesn't tell the user anything.
There was a problem hiding this comment.
I just rebased onto latest master.
Done adding a brailleText parameter to ui.message.
Done moving "Unable to copy" within ui.reportTextCopiedToClipboard.
Regarding the lengthier spoken message, I felt it was closer to what is currently announced eg. in browse mode.
Let me know if you wish I change this anyway.
@JulienCochuyt Thanks for checking. |
|
@feerrenrut Any updates on this PR? |
|
It seems all requested changes are addressed on this one. @feerrenrut Could it be that this got of your radar? |
|
Not sure if it comes from this PR, but I get now following error in NVDA alpha Version: alpha-21386,53cecfd7 STR:
Actual: Following error is raised and the selected text is not copied to the clipboard: Expected: No error and the selected text is copied to the clipboard. |
|
@Adriani90 wrote:
It does. My bad. Thank you for the report and STR. |
…ation from being reported.
Link to issue number:
Fixes #6757
Summary of the issue:
The 5 clipboard-related scripts do not uniformly emit acknowledgement messages.
They present success either with speech&braille or speech only.
They either report failure, or not.
Three of them are triple-press gestures. The possibly lengthy copied text being reported before the statement "copied to clipboard" does not help to make it clear something different occurred.
Description of how this pull request fixes the issue:
notifyparameter toapi.copyToClipto obtain the new standard behavior. This new parameter defaults toFalsenot to interfere with existing calls from addons.Testing performed:
Tested with both speech and braille:
Known issues with pull request:
This PR adds the first translated message to the
apimodule.If this is to be considered a problem, the message part could easily be moved out to something like
ui.acknowledgeCopyToClipboard(text: str, success: bool)Change log entry:
Section: Changes
NVDA will now report "Copied to clipboard" before the copied text.