Skip to content

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?

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