mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 10:56:10 +00:00
Fix the cleanup prompt language and harden detection parsing
Review found the detected language was only switching the glossary rule, not the base prompt: a detected Turkish recording with an English interface got the English cleanup prompt with a Turkish glossary footnote. Both now follow the spoken language, and the detected-language value is guarded against a server that returns something other than a string. The record reply is covered by a CLI test.
This commit is contained in:
@@ -722,6 +722,13 @@ class Replies(DikteTest):
|
||||
self.assertEqual(code, 0)
|
||||
self.assertEqual(out.strip(), "Book it for Thursday.")
|
||||
|
||||
def test_the_json_answer_carries_the_detected_language(self):
|
||||
code, out, _ = self.run_verb(
|
||||
["--json", "record"],
|
||||
{"ok": True, "text": "Selam", "speech_language": "tr"})
|
||||
self.assertEqual(code, 0)
|
||||
self.assertEqual(json.loads(out)["speech_language"], "tr")
|
||||
|
||||
def test_a_dictation_that_failed(self):
|
||||
code, out, err = self.run_verb(["stop", "--wait"],
|
||||
{"ok": False, "error": "No speech detected"})
|
||||
|
||||
Reference in New Issue
Block a user