diff --git a/README.md b/README.md index f8421b3..41b2bf4 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,16 @@ PDF file, base file names in the case of image files, or `baseFileName-pageNumbe of multiple PDF files. Without specifying the braces, textra will append a dash followed by the page number/base file name to the specified path. +## Troubleshooting + +- **`ERROR: Speech recognizer does not support on-device recognition`**: + + If you get this error, you may need dictation enabled, which you can accomplish in **System Settings** -> **Keyboard** -> **Dictation** -> **Enable dictation**. + + Flipping the dictation setting may not immediately fix the error. If `textra` still provides this error or if you cannot toggle the setting, try clicking the "Edit" menu item from the top menu bar when you're in an application (e.g. Terminal) and clicking "Start dictation." This may prompt you to enable "Dictation" again, and a microphone prompt may appear (which you can immediately dismiss by clicking "Done"). + + Try `textra` again. If it does work, you may safely disable dictation at any time in the system settings. If it does not, please file an issue. + ## License MIT diff --git a/test/test.py b/test/test.py index 76c8280..867410d 100644 --- a/test/test.py +++ b/test/test.py @@ -288,6 +288,25 @@ def assert_has_error(stdout, stderr, file_contents): ], ) +run( + "textra -l en", + [ + assert_no_file_contents, + assert_no_stdout, + assert_no_error, + assert_stderr_matches("textra -h"), + ], +) + +run( + "textra -l en docp1.png -o docp1.txt", + [ + assert_files(["docp1.txt"]), + assert_no_stdout, + assert_no_error, + ], +) + # Error cases run( "textra --invalidoption", @@ -335,6 +354,20 @@ def assert_has_error(stdout, stderr, file_contents): ], ) +run( + "textra -l", [assert_no_file_contents, assert_no_stdout, assert_has_error("locale")] +) + +run( + "textra docp1.png -l en", + [assert_no_file_contents, assert_no_stdout, assert_has_error("-l")], +) + +run( + "textra -l en -l es", + [assert_no_file_contents, assert_no_stdout, assert_has_error("-l")], +) + # TODO: investigate why these fail (but only in Python?) # run( # [