Skip to content

[Feature]convert eng.srt to another language #463#469

Open
lianzthang wants to merge 3 commits intoAndrews54757:mainfrom
lianzthang:feature/auto-translate
Open

[Feature]convert eng.srt to another language #463#469
lianzthang wants to merge 3 commits intoAndrews54757:mainfrom
lianzthang:feature/auto-translate

Conversation

@lianzthang
Copy link

Description

Implemented an "Auto-Translate" feature for subtitles using Google Translate.

Features

  • Robust Translator: Added SubtitleTranslator.mjs module that rotates between 3 different Google endpoints (clients5, te, gtx) to prevent 429 rate limits.
  • Smart Recovery: Added interactive CAPTCHA detection. If Google blocks the IP, it opens a tab for the user to solve the "I am not a robot" check and then resumes automatically.
  • UI Updates: Added a "Trans:" dropdown to the subtitle menu.
  • UX Improvements: Automatically hides the original English track when translation starts so the user only sees the new language.
  • Safety: Uses dynamic imports to ensure the player core never crashes even if the translation module fails to load.

@Andrews54757
Copy link
Owner

this is a good idea but one that will have to be disabled for the chrome extension store in order to get approval from google

@lianzthang
Copy link
Author

Understood. How would you prefer I disable it for the store build? Should I wrap the functionality in a check for a specific build flag or constant (e.g., ENABLE_TRANSLATION), or do you handle that in the build script?

@ale5000-git
Copy link

ale5000-git commented Jan 9, 2026

Hi, is it possible to make it working also in other ways?
For example I see many YouTube video that only have Chinese subtitles (which I don't understand) and I would like to translate them to English or other languages.

My suggestion is:
Translate from English if present otherwise translate from the default/first language.

@Andrews54757 Andrews54757 force-pushed the main branch 3 times, most recently from 3459abd to 8efb858 Compare January 13, 2026 08:46
- Implemented Auto-Translate feature (disabled by default for Chrome Web Store approval).
- Added 'autoTranslate' and 'defaultTranslateLanguage' settings to Options menu.
- Refactored language list into new 'DefaultLanguages.mjs' file.
- Fixed race condition in OptionsStore to ensure settings load before UI renders.
- Updated SubtitlesManager to hide translation UI completely when feature is disabled.
@lianzthang lianzthang force-pushed the feature/auto-translate branch from e1660c8 to d7d8c7a Compare January 31, 2026 04:27
@lianzthang
Copy link
Author

@Andrews54757 I added a options to enable in the settings. Will that work now?

@Andrews54757
Copy link
Owner

Sorry I will come back to this later, been a bit occupied with figuring out how to fix FS' Youtube playback on Firefox.

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.

3 participants