forked from wensonsmith/YoudaoTranslator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
121 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,12 @@ | ||
|
||
# YoudaoTranslate | 有道翻译 | ||
# variable-naming.alfredworkflow | ||
|
||
<p align="left"> | ||
<img alt="GitHub stars" src="https://visitor-badge.laobi.icu/badge?page_id=wensonsmith.YoudaoTranslate"/> | ||
<img alt="GitHub stars" src="https://img.shields.io/github/stars/wensonsmith/YoudaoTranslate?style=social"/> | ||
</p> | ||
|
||
![screenshot_1](screenshots/screenshot_1.png) | ||
- 在 [YoudaoTranslator](https://github.com/wensonsmith/YoudaoTranslator) 的基础上,将翻译的文本生成变量名; | ||
- 支持 `小驼峰`、`大驼峰`、 `小写下划线`、 `大写下划线` 四种变量命名规范; | ||
- 如果翻译结果不理想可以 `cmd + y` 组合键 Quick Look 网页查看其它结果; | ||
- 或者按住 `alt` 键回车,浏览器会打开 [Codelf](https://unbug.github.io/codelf/); | ||
- 配置参考 [YoudaoTranslator Wiki](https://github.com/wensonsmith/YoudaoTranslator/wiki); | ||
- 下载:[Releases](https://github.com/Coder-ZJQ/variable-naming.alfredworkflow/releases)。 | ||
|
||
## ⚠️ V3 更新说明 | ||
该版本使用 TS 重构,自带运行环境,不再依赖 PHP。同时支持多个平台的 API。 | ||
|
||
macOS Monterey 请使用 V3 版本! | ||
|
||
标记为施工中 (🚧) 特性 V3 尚未支持,如果需要使用,请切换到 V2 使用。 | ||
|
||
## 特性 | ||
- 🌟 [**无系统环境依赖**]() - 自带 [txiki](https://github.com/saghul/txiki.js) 运行环境,不再需要 PHP | ||
- 🌟 [**多平台支持**]() - 支持百度的翻译API | ||
- 🌐 [**中英文自动互翻**]() - 支持 `CamelCase` 驼峰短语翻译,长句自动换行 | ||
- 🎭 [**多语言支持**](screenshots/multi.jpg) - 可以识别中文、英文、日文、韩文、法文、俄文等 | ||
- 🎹 [**快捷键支持**]() - 双击 `⌥ Alt` 直接翻译选中内容 | ||
- 📢 [**英文发音**](screenshots/screenshot_3.png) - `⌘ Command` + `↩︎ Enter` 本地发音,`⌥ Alt` + `↩︎ Enter` 调用有道在线语音发音 | ||
- 🚧 [**有道翻译生词本**](screenshots/word-book.jpg) - 可以将陌生单词加入有道生词本 | ||
- 📃 [**回车复制**]() - 在选项上 `↩︎ Enter` 回车复制翻译结果 | ||
- 🚧 [**查询历史**](screenshots/translate_history.gif) - `yd *` 查询最近的翻译记录 | ||
- 🔮 [**网页预览**](screenshots/screenshot_4.gif) - 翻译结果上按 `⇧ Shift` 直接预览有道网页 | ||
- 🚧 [**自动更新**](screenshots/update.png) - 输入 `update` 检查更新 Workflow | ||
|
||
## 🚀 开始使用 | ||
|
||
🌚 遇到问题不要怕,扫码加群来解答,[**点击扫码**](screenshots/wechat-group.png) | ||
|
||
### 1. 下载安装 | ||
|
||
- [GitHub Releases 下载](https://github.com/wensonsmith/YoudaoTranslate/releases) | ||
- [又拍云下载 v3.1.0](https://img.seekbetter.me/workflows/YoudaoTranslator-3.1.zip) | ||
|
||
### 2. 配置Workflow | ||
|
||
[👉 请参考 wiki 进行配置](https://github.com/wensonsmith/YoudaoTranslator/wiki) | ||
## Contributors | ||
|
||
<a href="https://iwenson.com" target="_blank"><img src="https://avatars1.githubusercontent.com/u/2544185?s=120&v=4" height="60"/></a> | ||
<a href="https://blog.zthxxx.me" target="_blank"><img src="https://avatars0.githubusercontent.com/u/15135943?s=120&v=4" height="60"/></a> | ||
<a href="https://www.zzaning.com/#/" target="_blank"><img src="https://avatars2.githubusercontent.com/u/12035097?s=88&u=7e419cd2eb7b9fec5ba061d8135c4875a4c32323&v=4" height="60"/></a> | ||
|
||
## ~~Buy me a coffee~~ 🍼 冲奶粉! | ||
![微信支付](./screenshots/sponsor.PNG) | ||
|
||
## 使用库和参考资料 | ||
|
||
- https://github.com/joetannenbaum/alfred-workflow | ||
- https://www.alfredapp.com/help/workflows/inputs/script-filter/json/ | ||
- https://www.alfredapp.com/help/workflows/ | ||
![](./screenshots/usage.gif) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
export interface Formatter { | ||
name: string; | ||
format: (word: string) => string; | ||
} | ||
|
||
export class LowerCamelCase implements Formatter { | ||
name: string = "小驼峰" | ||
|
||
format(word: string): string { | ||
return word.split(" ").map((string, index) => { | ||
if (index > 0) { | ||
return string.slice(0, 1).toUpperCase() + string.slice(1).toLowerCase() | ||
} else { | ||
return string.toLowerCase() | ||
} | ||
}).join("") | ||
} | ||
} | ||
export class UpperCamelCase implements Formatter { | ||
name: string = "大驼峰" | ||
|
||
format(word: string): string { | ||
return word.split(" ").map((string, index) => { | ||
return string.slice(0, 1).toUpperCase() + string.slice(1).toLowerCase() | ||
}).join("") | ||
} | ||
} | ||
export class LowerUnderline implements Formatter { | ||
name: string = "小写下划线" | ||
|
||
format(word: string): string { | ||
return word.split(" ").map((string, index) => { | ||
return string.toLowerCase() | ||
}).join("_") | ||
} | ||
} | ||
export class UpperUnderline implements Formatter { | ||
name: string = "大写下划线" | ||
|
||
format(word: string): string { | ||
return word.split(" ").map((string, index) => { | ||
return string.toUpperCase() | ||
}).join("_") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters