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:
@@ -264,8 +264,10 @@ class CleanupPrompt(DikteTest):
|
||||
than the interface language."""
|
||||
self.write_config({"ui_language": "en", "transcribe_prompt": "Paraşüt"})
|
||||
conf = cfg.Config()
|
||||
self.assertIn("KONUŞMACININ KULLANDIĞI İSİM VE TERİMLER",
|
||||
conf.cleanup_prompt(speech="tr"))
|
||||
prompt = conf.cleanup_prompt(speech="tr")
|
||||
self.assertEqual(prompt, cfg.CLEANUP_PROMPT_TR
|
||||
+ cfg.GLOSSARY_RULE_TR.format(glossary="Paraşüt"))
|
||||
self.assertIn("KONUŞMACININ KULLANDIĞI İSİM VE TERİMLER", prompt)
|
||||
self.assertIn("NAMES AND TERMS THE SPEAKER USES",
|
||||
conf.cleanup_prompt(speech="de"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user