Skip to content

Commit

Permalink
add local api
Browse files Browse the repository at this point in the history
  • Loading branch information
zu1k committed Aug 28, 2021
1 parent 862cc8a commit 5accf5c
Show file tree
Hide file tree
Showing 8 changed files with 1,368 additions and 79 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ egui_glium = { git = "https://github.com/zu1k/egui.git", branch = "copy-translat
epi = { git = "https://github.com/zu1k/egui.git", branch = "copy-translator" }
enigo = { git = "https://github.com/enigo-rs/enigo" }
glium = "0.30"
deepl = { path = "./deepl" }
deepl = { path = "./deepl", features = ["online"] } # features must be specified, `local` or `online`
piet-common = "0.4.1"
tauri-hotkey = "0.1.2"
copypasta = "0.7.1"
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@ Copy Translator 是使用Rust编写的翻译小工具

开发初衷是辅助论文阅读,因为不喜欢内存黑洞Electron,便自己开发一个轻量且简单的来替代

## 使用说明

工具仅一个exe,启动后会驻留后台,选中文本后按 `ctrl+d``ctrl+q` 唤起翻译界面,`esc`关闭界面,`ctrl+shift+d`完全退出

在界面开启的情况下,可以通过选中文本触发翻译行为,无需快捷键,俗称“划词翻译”

![使用截图](./res/pic.png)

## Thanks
## 版本说明

因为DeepL的jsonrpc接口有速率限制,所以提供下面两个版本:

- `copy-translator-online`: 使用我搭建的DeepL接口,利用腾讯云云函数,出口多个IP
- `copy-translator-local`: 使用内嵌在程序中的DeepL接口,使用本地的出口IP

请尽量使用local版本

## 感谢列表

- [CopyTranslator](https://copytranslator.github.io/): Electron版本CopyTranslator
- [DeepL](https://deepl.com/): DeepL翻译
Expand Down
Loading

0 comments on commit 5accf5c

Please sign in to comment.