It allows you to export the translated text from the Chrome page renderer that appears below the video to the video itself. In addition, it automatically disables the default subtitles shown in the video and you have to manually translate the web page into your preferred language using the browser's built-in page translation feature.
To use this UserScript, you need a browser extension like Tampermonkey (for Chrome) or Greasemonkey (for Firefox) installed. Follow the steps below to install the script:
- Install the Tampermonkey/Greasemonkey extension in your browser if you haven't already.
- Create a new Tampermonkey/Greasemonkey script.
- Copy and paste the entire content of the JS code provided into the script editor.
- Save the script.
- Translates subtitles on Coursera.
- Styling enhancements to improve subtitle visibility and presentation.
The UserScript targets the Coursera website and executes when you visit any course page (URL starting with https://www.coursera.org/learn/).
When the UserScript runs, it injects custom CSS styles into the page. These styles modify the appearance and positioning of the subtitles. It creates a popup-like element with white text color, a semi-transparent black background, and rounded corners to display the translated subtitles on top of the original subtitles. The translated subtitles are centered and positioned above the original subtitles for better visibility.
Once the UserScript is installed and running, you can use the following features:
-
Disable Subtitles on the Video: To disable the original subtitles on the video page, you can use the video player's built-in subtitle toggle button. This toggle button will not interfere with the custom styles added by the UserScript.
-
Translate the Video Page Using Chrome Page Translation Tool: You can use your browser's Chrome page translation feature to translate the video page instantly into your preferred language. Here's how you can do it:
- Go to the Coursera video page in your browser.
- Click on the "Translate" icon located at the top right corner of your browser's address bar.
- Use the "Change Language" option to translate the page into your preferred language.
This script relies on the structure and classes of the Coursera website as of the last update. If Coursera updates its structure or classes, the UserScript might require adjustments to work correctly.
This UserScript is provided as-is and is not associated with or endorsed by Coursera or Google. The user is responsible for its usage and any consequences that may arise from using this script.
This UserScript is developed by hcode.
Current version: 0.1
This UserScript is distributed under the MIT License. Feel free to modify and distribute it as per the terms of the license.
For any issues or suggestions, please feel free to open an issue or contribute to the project on the GitHub repository.
Happy learning with translated subtitles!
