Skip to content

Commit

Permalink
Merge pull request #38 from liszd/develop
Browse files Browse the repository at this point in the history
有道翻译 workflow v2.0.0
  • Loading branch information
whyliam authored Apr 15, 2017
2 parents 7c68a7a + 00aae03 commit d0c7e0d
Show file tree
Hide file tree
Showing 13 changed files with 329 additions and 172 deletions.
Binary file modified 91C343E7-50D8-4B0D-9034-1C16C20DA8D4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 35 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# whyliam.workflows.youdao

## 有道翻译 workflow v1.2.5
## 有道翻译 workflow v2.0.0

默认快捷键 "yd",查看翻译结果。
默认快捷键 `yd`,查看翻译结果。

1. 英译中
2. 中译英
Expand All @@ -13,45 +13,57 @@
### 功能

1.`回车` 复制
2.`Control+回车` 打开有道翻译页面
3.`Command+回车` 直接在打出翻译结果
4.`Shift+回车` 直接发音
5. 选中文字 双击`Command`进行翻译(暂定)
2.`Control+回车` 打开有道翻译页面
3.`Command+回车` 直接在打出翻译结果
4.`Shift+回车` 直接发音
5. 选中文字 双击`Option ⌥`进行翻译

### 问题

如果出现`No JSON object could be decoded`
### 下载

![No JSON object could be decoded](https://cloud.githubusercontent.com/assets/12092275/16805774/590a4064-4944-11e6-9b12-d8218024c032.png)
[点击下载](https://github.com/liszd/whyliam.workflows.youdao/releases/download/2.0.0/whyliam.workflows.youdao.alfredworkflow)

请删除该文件
`/Users/用户名/Library/Application\ Support/Alfred\ 3/Workflow\ Data/whyliam.workflows.youdao`
### 安装

### 下载
1. [下载](https://github.com/liszd/whyliam.workflows.youdao/releases)最新版本双击安装
2. [注册](http://fanyi.youdao.com/openapi?path=data-mode)有道翻译API
3. 在Alfred的设置中填入对应的`Key``Keyfrom`
![](http://ww2.sinaimg.cn/large/006tNbRwgy1feno2vevklj31a30os0u5.jpg)
4. 在Alfred的设置中设置快捷方式键
![](http://ww2.sinaimg.cn/large/006tNbRwgy1feno6pzaxdj31a60p0jsl.jpg)

[点击下载](https://github.com/liszd/whyliam.workflows.youdao/releases/download/1.2.5/whyliam.workflows.youdao.alfredworkflow)

## Demo
### 演示

#### 英译中

![](http://ww2.sinaimg.cn/large/48910e01gw1erucr05z85g213p0kbqhn.gif)
![](http://ww3.sinaimg.cn/large/006tNbRwgy1fenonlxdjwg30sv0r7wkd.gif)

#### 中译英

![](http://ww2.sinaimg.cn/large/48910e01gw1erucrd5tnmg213p0kbk6q.gif)
![](http://ww1.sinaimg.cn/large/006tNbRwgy1fenonzclvfg30sw0r90zo.gif)

#### 翻译短语

![](http://ww2.sinaimg.cn/large/48910e01gw1erucrvb9a8g213p0kbqhn.gif)
![](http://ww3.sinaimg.cn/large/006tNbRwgy1fenooolrkpg30t00r47bg.gif)

#### 发音 - 按`Shift ⇧+回车`

![](http://ww3.sinaimg.cn/large/006tNbRwgy1fenooolrkpg30t00r47bg.gif)

#### 打开有道翻译页面 - 按`Control ⌃+回车`

![](http://ww2.sinaimg.cn/large/006tNbRwgy1fenopnjw9qg30tj0r5n8k.gif)

#### 直接在打出翻译结果 - 按`Command ⌘+回车`

![](http://ww3.sinaimg.cn/large/006tNbRwgy1fenomln8jdg30sx0r4wg2.gif)

#### 打开有道翻译页面 - `Control+回车`
#### 双击快速翻译 - 双击`Option ⌥`

![](http://ww4.sinaimg.cn/large/48910e01gw1erucsmvtkgg213l0kaqq2.gif)
![](http://ww1.sinaimg.cn/large/006tNbRwgy1fenosusv0bg30qn0qpq7a.gif)

#### 直接在打出翻译结果 - 按`Command+回车`
### 更多

![](http://ww3.sinaimg.cn/large/48910e01gw1eructbvt9rg213p0jh0wi.gif)
更多问题参见[Alfred 有道翻译简介](https://blog.naaln.com/2017/04/alfred-youdao-intro/)

---

Expand Down
Binary file modified icon.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 modified icon_basic.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 icon_error.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 modified icon_phonetic.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 icon_update.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 modified icon_web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
171 changes: 114 additions & 57 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<key>modifiersubtext</key>
<string>有道发音</string>
<key>vitoclose</key>
<false/>
<true/>
</dict>
<dict>
<key>destinationuid</key>
Expand All @@ -77,6 +77,19 @@
<false/>
</dict>
</array>
<key>F99C4C55-10F5-4D62-A77D-F27058629B21</key>
<array>
<dict>
<key>destinationuid</key>
<string>6A03FDC5-89AC-4F9D-9456-3762ACA751FE</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
</dict>
<key>createdby</key>
<string>whyliam</string>
Expand All @@ -96,8 +109,7 @@
<key>escaping</key>
<integer>35</integer>
<key>script</key>
<string>query={query}
open "http://dict.youdao.com/search?q=`echo $query | awk 'BEGIN{FS="$"} {print $1}'`"</string>
<string>/usr/bin/python splitargs.py "{query}" 0</string>
<key>scriptargtype</key>
<integer>0</integer>
<key>scriptfile</key>
Expand All @@ -112,13 +124,32 @@ open "http://dict.youdao.com/search?q=`echo $query | awk 'BEGIN{FS="$"} {print $
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>browser</key>
<string></string>
<key>spaces</key>
<string></string>
<key>url</key>
<string>http://dict.youdao.com/search?q={query}</string>
<key>utf8</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.action.openurl</string>
<key>uid</key>
<string>6A03FDC5-89AC-4F9D-9456-3762ACA751FE</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>33</integer>
<integer>35</integer>
<key>script</key>
<string>/usr/bin/python splitargs.py "{query}" 2</string>
<key>scriptargtype</key>
Expand All @@ -143,13 +174,13 @@ open "http://dict.youdao.com/search?q=`echo $query | awk 'BEGIN{FS="$"} {print $
<key>argumenttype</key>
<integer>0</integer>
<key>escaping</key>
<integer>32</integer>
<integer>35</integer>
<key>keyword</key>
<string>yd</string>
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
<true/>
<false/>
<key>queuedelaymode</key>
<integer>1</integer>
<key>queuemode</key>
Expand Down Expand Up @@ -201,7 +232,7 @@ open "http://dict.youdao.com/search?q=`echo $query | awk 'BEGIN{FS="$"} {print $
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>34</integer>
<integer>32</integer>
<key>script</key>
<string>/usr/bin/python splitargs.py "{query}" 1</string>
<key>scriptargtype</key>
Expand All @@ -218,13 +249,46 @@ open "http://dict.youdao.com/search?q=`echo $query | awk 'BEGIN{FS="$"} {print $
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>action</key>
<integer>1</integer>
<key>argument</key>
<integer>1</integer>
<key>argumenttext</key>
<string>yd </string>
<key>focusedappvariable</key>
<false/>
<key>focusedappvariablename</key>
<string></string>
<key>hotkey</key>
<integer>-1</integer>
<key>hotmod</key>
<integer>524288</integer>
<key>hotstring</key>
<string>double tap</string>
<key>leftcursor</key>
<false/>
<key>modsmode</key>
<integer>0</integer>
<key>relatedAppsMode</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.hotkey</string>
<key>uid</key>
<string>5751065C-52C1-4D19-8F7D-03B730BFE440</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>34</integer>
<integer>32</integer>
<key>script</key>
<string>/usr/bin/python splitargs.py "{query}" 1</string>
<key>scriptargtype</key>
Expand Down Expand Up @@ -258,117 +322,110 @@ open "http://dict.youdao.com/search?q=`echo $query | awk 'BEGIN{FS="$"} {print $
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>action</key>
<integer>1</integer>
<key>argument</key>
<integer>1</integer>
<key>argumenttext</key>
<string>yd </string>
<key>focusedappvariable</key>
<false/>
<key>focusedappvariablename</key>
<string></string>
<key>hotkey</key>
<integer>0</integer>
<key>hotmod</key>
<integer>0</integer>
<key>leftcursor</key>
<false/>
<key>modsmode</key>
<integer>0</integer>
<key>relatedAppsMode</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.hotkey</string>
<key>uid</key>
<string>5751065C-52C1-4D19-8F7D-03B730BFE440</string>
<key>version</key>
<integer>2</integer>
</dict>
</array>
<key>readme</key>
<string>有道翻译 Workflow v1.2.5
<string>有道翻译 Workflow v2.0.0
默认快捷键 "yd", 查看翻译结果。
默认快捷键 yd, 查看翻译结果。
1. 英译中
2. 中译英
3. 翻译短语句子
4. 打开有道翻译页面,查看详细内容
5. 直接在打出翻译结果
*功能*
功能
1. 按`回车`复制
2. 按`Control+回车`打开有道翻译页面
3. 按`Comman+回车`直接在打出翻译结果
4. 按`Shift+回车`直接发音
5. 选中文字 双击`Command`进行翻译(暂定)</string>
5. 选中文字 双击`Command`进行翻译
更多
参见 https://blog.naaln.com/2017/04/alfred-youdao-intro/</string>
<key>uidata</key>
<dict>
<key>0907BEF4-816F-48FF-B157-03F5C2AACEAB</key>
<dict>
<key>xpos</key>
<integer>700</integer>
<integer>830</integer>
<key>ypos</key>
<real>390</real>
<integer>440</integer>
</dict>
<key>27E60581-8105-41DD-8E29-4FE811179098</key>
<dict>
<key>xpos</key>
<integer>500</integer>
<key>ypos</key>
<real>240</real>
<integer>290</integer>
</dict>
<key>4473C9D3-7A15-4D31-84F6-A096A7CFF46C</key>
<dict>
<key>xpos</key>
<integer>700</integer>
<integer>830</integer>
<key>ypos</key>
<real>120</real>
<integer>150</integer>
</dict>
<key>5751065C-52C1-4D19-8F7D-03B730BFE440</key>
<dict>
<key>note</key>
<string>双击设置快捷方式</string>
<key>xpos</key>
<integer>270</integer>
<key>ypos</key>
<integer>430</integer>
</dict>
<key>6A03FDC5-89AC-4F9D-9456-3762ACA751FE</key>
<dict>
<key>xpos</key>
<integer>310</integer>
<integer>830</integer>
<key>ypos</key>
<integer>480</integer>
<integer>40</integer>
</dict>
<key>7C1ABC41-3B36-401F-96C7-30BCB39181FF</key>
<dict>
<key>xpos</key>
<integer>500</integer>
<key>ypos</key>
<real>390</real>
<integer>440</integer>
</dict>
<key>91C343E7-50D8-4B0D-9034-1C16C20DA8D4</key>
<dict>
<key>xpos</key>
<integer>300</integer>
<integer>270</integer>
<key>ypos</key>
<real>120</real>
<integer>250</integer>
</dict>
<key>DBA62127-3B78-4B80-B82B-1C6AEC393003</key>
<dict>
<key>xpos</key>
<integer>700</integer>
<integer>830</integer>
<key>ypos</key>
<real>240</real>
<integer>290</integer>
</dict>
<key>F99C4C55-10F5-4D62-A77D-F27058629B21</key>
<dict>
<key>xpos</key>
<integer>500</integer>
<key>ypos</key>
<real>10</real>
<integer>40</integer>
</dict>
</dict>
<key>variables</key>
<dict>
<key>youdao_key</key>
<string>1947745091</string>
<key>youdao_keyfrom</key>
<string>whyliam-wf-12</string>
</dict>
<key>variablesdontexport</key>
<array>
<string>youdao_keyfrom</string>
<string>youdao_key</string>
</array>
<key>version</key>
<string>1.2.5</string>
<string>2.0.0</string>
<key>webaddress</key>
<string>https://github.com/liszd/whyliam.workflows.youdao</string>
</dict>
Expand Down
Loading

0 comments on commit d0c7e0d

Please sign in to comment.