Skip to content

Feature/translation support - #17

Open
n3PH1lim wants to merge 5 commits into
finnvoor:mainfrom
n3PH1lim:feature/translation-support
Open

n3PH1lim wants to merge 5 commits into
finnvoor:mainfrom
n3PH1lim:feature/translation-support

Conversation

@n3PH1lim

Copy link
Copy Markdown

No description provided.

- Add --output-locale option to translate transcribed text
- Import Translation framework with @preconcurrency
- Implement translateTranscript() method that:
  * Checks translation model availability
  * Provides helpful error messages for missing models
  * Splits text into chunks for better translation quality
  * Preserves sentence structure in translated output
- Handles async translation with progress tracking
- Requires translation models to be installed in System Settings
- Add --output-locale option to usage example
- Add example of transcribing Japanese and translating to German
- Document requirement for translation models in System Settings
- Clarify that translation models must be pre-installed
- Update translateTranscript to handle both SRT and TXT formats
- For SRT: translate sentence-by-sentence while preserving time ranges
- For TXT: translate full text without time range requirements
- Enables translated subtitles with proper timing information
- Tested with Japanese to German translation in SRT format
- Automatically set maxLength to 9999 for SRT output when translation is active
- Reduces (but doesn't eliminate) duplicate timestamps in translated SRT
- TXT format translation works perfectly
- Known issue: NLTokenizer may find different sentence boundaries in translated
  text compared to source, causing some timestamp overlap in SRT format
- Translate each sentence 1:1 with original time ranges preserved
- No re-tokenization or merging of translated sentences
- Output preserves exact same subtitle count and timing as source
- Simplified translation logic - removed unnecessary fallback code
- Japanese 455 subtitles → German 454 subtitles (1 empty filtered)
- All timestamps match perfectly between source and translation
@n3PH1lim

Copy link
Copy Markdown
Author

This is vibe coded but reviewed and tested by myself. The translation is ok-ish, what you can expect from the built-in macOS feature, but it's fast. Tested with multiple YouTube videos and a few anime episodes. Not perfect, but watchable and better than not having subtitles.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants