i18n tts error message

This commit is contained in:
Damien Elmes 2021-04-08 09:35:19 +10:00
parent 28f830730e
commit 1ee4385fcf
2 changed files with 3 additions and 5 deletions

View File

@ -40,3 +40,4 @@ errors-unable-open-collection =
Anki was unable to open your collection file. If problems persist after restarting your computer, please use the Open Backup button in the profile manager. Anki was unable to open your collection file. If problems persist after restarting your computer, please use the Open Backup button in the profile manager.
Debug info: Debug info:
errors-windows-tts-runtime-error = The TTS service failed. Please ensure Windows updates are installed, try restarting your computer, and try using a different voice.

View File

@ -41,7 +41,7 @@ from anki.sound import AVTag, TTSTag
from anki.utils import checksum, isWin, tmpdir from anki.utils import checksum, isWin, tmpdir
from aqt import gui_hooks from aqt import gui_hooks
from aqt.sound import OnDoneCallback, SimpleProcessPlayer from aqt.sound import OnDoneCallback, SimpleProcessPlayer
from aqt.utils import tooltip from aqt.utils import tooltip, tr
@dataclass @dataclass
@ -569,10 +569,7 @@ if isWin:
try: try:
ret.result() ret.result()
except RuntimeError: except RuntimeError:
# fixme: i18n if this turns out to happen frequently tooltip(tr.errors_windows_tts_runtime_error())
tooltip(
"TTS failed to play. Please check available languages in system settings."
)
return return
# inject file into the top of the audio queue # inject file into the top of the audio queue