Skip to content

Commit

Permalink
chore: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopsken committed Oct 4, 2018
1 parent ba51310 commit 94b5b3f
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 6 deletions.
51 changes: 49 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,49 @@
# YoudaoTranslate
A LaunchBar action to translate words.
# 有道翻译(Youdao Translate)

<p align="center">
<img
alt="screentshot_1.png"
src="https://github.com/Hopsken/YoudaoTranslate/raw/master/screenshots/screenshot_1.png" />
</p>

## 一、特性

### 1.支持中英文互翻

### 2.支持 Instant Send 功能

### 3.支持整句翻译

### 4.支持显示多种释义
<p align="center">
<img
alt="screentshot_1.png"
src="https://github.com/Hopsken/YoudaoTranslate/raw/master/screenshots/screenshot_2.png" />
</p>

### 5.支持快速预览 `Cmd + Y`
![screentshot_3: Quick Look](https://github.com/Hopsken/YoudaoTranslate/raw/master/screenshots/screenshot_3.gif)

## 二、下载使用

[从 Github 下载](https://github.com/Hopsken/YoudaoTranslate/archive/master.zip)

下载完成后打开压缩包,将其中的 `Youdao Translate.lbaction` 拖放到 `~/Library/Application Support/LaunchBar/Actions` 目录下。

## 三、配置 Keys

由于有道翻译 API 迁移到了有道智云,所以大家需要去[有道智云](http://ai.youdao.com/)进行注册然后创建应用才能使用。步骤如下:

1. 注册有道智云账号。
2. 创建一个自然语言翻译服务。
3. 创建一个应用并绑定第二步创建的服务。
4. 这样就能得到应用 ID和应用密钥了。
5. 然后在 LaunchBar 中输入 `yd` 启动 Action 后,输入 `~` 以启用配置模式,将得到的应用 ID 粘贴到后面,按回车确认。

![screentshot_3: Quick Look](https://github.com/Hopsken/YoudaoTranslate/raw/master/screenshots/screenshot_4.gif)


## 四、参考资料

[wensonsmith/YoudaoTranslate](https://github.com/wensonsmith/YoudaoTranslate)
[blueimp/JavaScript-MD5](https://github.com/blueimp/JavaScript-MD5)
4 changes: 2 additions & 2 deletions Youdao Translate.lbaction/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<key>CFBundleIdentifier</key>
<string>com.hopsken.LaunchBar.action.YoudaoTranslate</string>
<key>CFBundleName</key>
<string>Youdao Translate</string>
<string>有道翻译</string>
<key>CFBundleVersion</key>
<string>0.0.1</string>
<string>1.0.0</string>
<key>LBAbbreviation</key>
<string>yd</string>
<key>LBDescription</key>
Expand Down
Empty file.
4 changes: 2 additions & 2 deletions Youdao Translate.lbaction/Contents/Scripts/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function setCustomClientId(argument) {
}
function setCustomApiKey(argument) {
Action.preferences.API_KEY = argument
LaunchBar.alert('成功设置应用密钥!', `应用 ID 为${argument}`, '确认')
LaunchBar.alert('成功设置应用密钥!', `应用密钥为${argument}`, '确认')
}

/**
Expand Down Expand Up @@ -128,7 +128,7 @@ function parseBasic(obj) {
function parseWeb(arr) {
return arr.map(item => ({
value: item.value.join('; '),
key: item.key
key: '网络释义:' + item.key
}))
}

Expand Down
Binary file added screenshots/screenshot_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/screenshot_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/screenshot_3.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 added screenshots/screenshot_4.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 94b5b3f

Please sign in to comment.