Add subtitle translation presets, custom instructions, and per-series glossary #2

Merged
vokhactri merged 2 commits from feat/subtitle-translation-presets into main 2026-11-07 13:28:32 +07:00
vokhactri commented 2026-11-07 13:27:12 +07:00 (Migrated from github.com)

Summary

  • Add selectable subtitle translation style presets (General, Chinese animation/wuxia/xianxia, Japanese anime, Korean drama, Western, Documentary). The Chinese animation preset converts pinyin names and cultivation terms to Sino-Vietnamese forms when the target is Vietnamese.
  • Add an "Additional instructions" text field in translation settings that is appended to the system prompt.
  • Build a per-series glossary: the model extracts recurring proper nouns from a sample of the episode, and the result is saved next to the series in app data. Episodes in the same folder share the glossary, and it can be edited from Subtitles → Edit Translation Glossary….
  • Bump the translation cache version and include preset, custom instructions, and glossary in the cache key, so changed settings produce a fresh translation.
  • Fix issues found while testing: missing QtQuick.Layouts import that prevented the app from starting, a cancelled extraction job continuing to run alongside a new one, video streams sharing a glossary (streams now skip it and the menu item is disabled), long subtitles only sampling the first ~30k characters (sampling now spreads across the whole episode), a glossary dialog list with no height, and duplicated cache-key code merged into one helper.

Testing

  • Build completes with no warnings.
  • Unit tests pass (5/5), including the new glossarystoretest covering save, load, and merge of glossary entries.
  • App launches and loads Main.qml without QML errors.
  • Not run: manual end-to-end translation with a live API. The glossary edit dialog and the automatic extraction step have not been exercised by hand.
  • Not run: cache behavior across preset or glossary changes beyond code review.
## Summary - Add selectable subtitle translation style presets (General, Chinese animation/wuxia/xianxia, Japanese anime, Korean drama, Western, Documentary). The Chinese animation preset converts pinyin names and cultivation terms to Sino-Vietnamese forms when the target is Vietnamese. - Add an "Additional instructions" text field in translation settings that is appended to the system prompt. - Build a per-series glossary: the model extracts recurring proper nouns from a sample of the episode, and the result is saved next to the series in app data. Episodes in the same folder share the glossary, and it can be edited from Subtitles → Edit Translation Glossary…. - Bump the translation cache version and include preset, custom instructions, and glossary in the cache key, so changed settings produce a fresh translation. - Fix issues found while testing: missing `QtQuick.Layouts` import that prevented the app from starting, a cancelled extraction job continuing to run alongside a new one, video streams sharing a glossary (streams now skip it and the menu item is disabled), long subtitles only sampling the first ~30k characters (sampling now spreads across the whole episode), a glossary dialog list with no height, and duplicated cache-key code merged into one helper. ## Testing - Build completes with no warnings. - Unit tests pass (5/5), including the new `glossarystoretest` covering save, load, and merge of glossary entries. - App launches and loads `Main.qml` without QML errors. - Not run: manual end-to-end translation with a live API. The glossary edit dialog and the automatic extraction step have not been exercised by hand. - Not run: cache behavior across preset or glossary changes beyond code review.
Sign in to join this conversation.