ChatGPT-Seitenübersetzungs-Button

🍓 Lassen Sie ChatGPT die Webseite, die Sie gerade lesen, mit einem Klick übersetzen

Version vom 18.04.2023. Aktuellste Version

Autor
mefengl
Bewertungen
0 0 0
Version
0.1.10
Erstellt am
15.04.2023
Letzte Aktualisierung
18.04.2023
Größe
12,7 KB
Lizenz
MIT
Wird angewandt auf
Alle Seiten

chatgpt-page-translate-button

A userscript that adds a "Translate to Chinese" button on any webpage. When clicked, it sends the text from the webpage to ChatGPT for translation and then displays the translated text on the ChatGPT web interface.

Installation

  1. Install a userscript manager like Tampermonkey or Greasemonkey.
  2. Click chatgpt-page-translate-button to the greasyfork page to install the userscript.
  3. Visit any website, and you will see a "Translate to Chinese" button at the topright corner of the page.

Usage

When you visit a webpage with the userscript installed, you'll see a "Translate to Chinese" button at the topright corner of the page. Click the button to send the text from the webpage to ChatGPT for translation. The translated text will be displayed on the ChatGPT web interface.

Code structure

  • main.ts: The main script that initializes the translation process and creates the translate button.
  • createButton.ts: A helper module that creates the "Translate to Chinese" button and adds it to the webpage.
  • getParagraphs.ts: A helper module that extracts paragraphs from the webpage.
  • chatkit.ts: A module that handles the communication with the ChatGPT API.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests to improve this userscript.

Credits

This userscript uses the Mozilla Readability library to extract content from webpages.

License

This project is licensed under the MIT License.

Respository link: chat-play/apps/page-translate-button

Build code repository link: https://github.com/mefengl/chatgpt-page-translate-button (this repo only contains the built code for greasyfork to automatically update the script)