Translate Buttons for beta.character.ai

Adds a translate buttons for character messages in the chat for beta.character.ai

目前为 2022-12-13 提交的版本。查看 最新版本

作者
CriDos
评分
0 0 0
版本
1.5
创建于
2022-12-12
更新于
2022-12-13
大小
3.0 KB
许可证
MIT
适用于

This script adds translate buttons to chat messages on the site beta.character.ai. When a user clicks on a translate button, the script will use the Google Translate API to translate the message into the user's default language. The translated message will be displayed in place of the original message, and clicking the translate button again will restore the original message.

To use the script, first ensure that you are on a chat page on the beta.character.ai site, for example: https://beta.character.ai/chat?char=12345. Then, the script will automatically add translate buttons to the chat messages.

The script uses the GM_xmlhttpRequest function to make API requests to the Google Translate service. It also uses the navigator.language property to determine the user's default language, and the setInterval function to periodically check for new chat messages and add translate buttons to them.

The script is licensed under the MIT license.