From 1ee4385fcf6f38ea7a16e8396ea54e694ba36279 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 8 Apr 2021 09:35:19 +1000 Subject: [PATCH] i18n tts error message --- ftl/qt/errors.ftl | 1 + qt/aqt/tts.py | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ftl/qt/errors.ftl b/ftl/qt/errors.ftl index 8f7c86805..c3bca0475 100644 --- a/ftl/qt/errors.ftl +++ b/ftl/qt/errors.ftl @@ -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. 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. diff --git a/qt/aqt/tts.py b/qt/aqt/tts.py index 2b71a79f5..2088f639e 100644 --- a/qt/aqt/tts.py +++ b/qt/aqt/tts.py @@ -41,7 +41,7 @@ from anki.sound import AVTag, TTSTag from anki.utils import checksum, isWin, tmpdir from aqt import gui_hooks from aqt.sound import OnDoneCallback, SimpleProcessPlayer -from aqt.utils import tooltip +from aqt.utils import tooltip, tr @dataclass @@ -569,10 +569,7 @@ if isWin: try: ret.result() except RuntimeError: - # fixme: i18n if this turns out to happen frequently - tooltip( - "TTS failed to play. Please check available languages in system settings." - ) + tooltip(tr.errors_windows_tts_runtime_error()) return # inject file into the top of the audio queue