diff --git a/source/ui.py b/source/ui.py index 6bcab338289..74720c9bbeb 100644 --- a/source/ui.py +++ b/source/ui.py @@ -106,10 +106,16 @@ def reportTextCopiedToClipboard(text: Optional[str] = None): # or the clipboard content did not match what was just copied. message(_("Unable to copy")) return + # Depending on the speech synthesizer, large amount of spoken text can freeze NVDA (#11843) + if len(text) < 1024: + spokenText = text + else: + # Translators: Spoken instead of a lengthy text when copied to clipboard. + spokenText = _("%d characters") % len(text) message( # Translators: Announced when a text has been copied to clipboard. # {text} is replaced by the copied text. - text=_("Copied to clipboard: {text}").format(text=text), + text=_("Copied to clipboard: {text}").format(text=spokenText), # Translators: Displayed in braille when a text has been copied to clipboard. # {text} is replaced by the copied text. brailleText=_("Copied: {text}").format(text=text)