Skip to content

MuelNova/nonebot_plugin_deepl_translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepL 翻译器 for nonebot2

一个基于DeepLnonebot2翻译插件

安装

  1. 在你的插件目录下克隆本项目
git clone https://github.com/Nova-Noir/nonebot_plugin_deepl_translator.git
  1. .env下添加配置项
DEEPL_API_KEYS = ['Your_API_Here', 'Another_API']
  1. 重启你的BOT

使用

你可以轻松通过使用语言代码回复你想要翻译的聊天来翻译句子

例如:

A: Hello, World!

A: Hello, World!

B:cn

A: Hello, World!

Bot: 你好,世界!

注意,这里需要使用QQ的回复功能,回复自带的@可以不删除。

image

同时,你也可以通过在想要发送的句子之前添加语言代码来自动翻译你想要发送的句子

例如:

A: jp你好世界

A: jp你好世界

Bot: ハロー・ワールド

image

语言代码

deepl_translator内置了多个常用的语言代码,语言代码对大小写不敏感,你可以在下表中找到对应

语言代码 DeepL代码 语言
CN ZH Chinese
JP JA Japanese
EN EN-US English (American)
FR FR French
RU RU Russian
DE DE German
ES ES Spanish

你也可以自主添加别名或添加新的语言,只需打开__init__.py,找到country_code并添加项目即可,他的格式应该是'语言代码': 'DeepL代码'

DeepL代码可以在这里找到

About

A nonebot plugin to translate chats

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages