Skip to content

Commit

Permalink
Update to Version 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wizyoung committed Jan 22, 2018
1 parent b787337 commit f568ec2
Show file tree
Hide file tree
Showing 12 changed files with 440 additions and 123 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Wizyoung
Copyright (c) 2018 Wizyoung

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
58 changes: 24 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,41 @@
# googletranslate.popclipext
一个免费的谷歌翻译popclip插件。
# Google Translate(PopClipExtension)
[中文说明](https://github.com/wizyoung/googletranslate.popclipext/blob/master/README_CN.md)

### 1. 使用
A unofficial free Google translate PopClip Extension based on [Googletrans Python API](https://github.com/ssut/py-googletrans) and [cocoaDialog](https://cocoadialog.com/).

- 使用效果:
## Preview

鼠标划中待翻译句子,点击翻译图标,右上角弹出翻译。
- English to Chinese (Simplified):

**右上角Bubble弹窗默认4秒后自动消失,若鼠标移动到Bubble内,则不会自动消失。**
![](https://github.com/wizyoung/googletranslate.popclipext/blob/master/screenshots/en2cn.gif)

- 英译中:
- Chinese (Simplified) to English:

![](https://raw.githubusercontent.com/wizyoung/googletranslate.popclipext/master/3.gif)
![](https://github.com/wizyoung/googletranslate.popclipext/blob/master/screenshots/cn2en.gif)

- 中译英:
The pop-up Bubble containing translation results will disappear automatically after 4 sec unless you move the mouse into it.

![](https://github.com/raw/wizyoung/googletranslate.popclipext/master/4.gif)
## Settings

- 使用方法:
- `Google Translate Site`: Choosing from `translate.google.cn` (default) or `translate.google.com`. The `.cn` server is for users in mainland China where the `.com` server is blocked by the government.
- `Destination Language` and `Mother Language`: If the selected text is not the `Mother Language`, the words will be translated to the `Mother Language`. Else, the words will be translated to the `Destination Language`.
- `Output Window Location`: Where the result window will be. Choosing from `topright `(default) or `center`.
- `Copy the results`: Wether to copy the results to clipboard after the translation.

初次使用,设置`Google Translate Site``Target Foreign Language``Output Window Location`字段,并勾选是否`复制结果到剪贴板`
![](https://github.com/wizyoung/googletranslate.popclipext/blob/master/screenshots/settings.png?raw=true)

- `Google Translate Site`: 要使用的谷歌翻译服务器。墙内的朋友请选择`translate.google.cn`,墙外的选择`translate.google.com`
- `Target Foreign Language`: 目标外语。程序将对划中的语言进行检测,若为中文,则翻译为选中的目标外语;若为非中文,无论什么语言,一律翻译为中文。
You can change all these settings after clicking the pencil shaped icon at the bottom of the popclip drop-down list.

## Install

- `Output Window Location`:选择翻译结果是在右上角显示,还是屏幕中央弹窗显示。默认前者。
Unzip the file from [Releases](https://github.com/wizyoung/googletranslate.popclipext/releases) and double click the .popclipext file to install it.

- 若勾选`复制结果到剪贴板`每次翻译的结果将自动复制到剪贴板,默认该选项关闭。
## TODO

![](https://github.com/wizyoung/googletranslate.popclipext/blob/master/settings.png?raw=true)

- 若要后期更改设置,点击popclip下拉列表,再点击最下面的笔标记,会看到`Google Translate`插件右边有个齿轮图标,点击进去即可修改。


### 2. 致谢

- 翻译API:目前谷歌翻译API已经开始收费,想用爬虫去爬谷歌翻译网页版,却有TK校验值问题。网上大部分TK校验值破解方法均已失效。多亏[py-googletrans](https://github.com/ssut/py-googletrans)提供了稳定的TK校验值破解方法,才能做成这个插件。对它们的工作表示感谢
- 界面: 弹窗显示界面使用了[cocoaDialog](http://mstratman.github.io/cocoadialog/)
- 图标: 感谢[linivor](https://github.com/linivor)[lfcxlfcx](https://github.com/lfcxlfcx)同学对改插件图标提出中肯意见并帮忙修改,同时感谢[linivor](https://github.com/linivor)同学提供的软件测试服务。

### 3. 附加说明

本人同时制作了官方API版本的谷歌翻译popclip插件,需要的可Email联系本人。

### 4. 下载链接

[Release](https://github.com/wizyoung/googletranslate.popclipext/releases)
- [ ] Result Bubble beside the selected words.

## Thank You

- [Googletrans Python API](https://github.com/ssut/py-googletrans): A **free** and **unlimited** python library that implemented Google Translate API.
- [cocoaDialog](https://cocoadialog.com/): Create macOS dialogs from the command line easily.
- [Turbo_祥](https://weibo.com/u/2627732300?topnav=1&wvr=6&topsug=1) and [把那该死的球传给我](https://weibo.com/u/2282786300?refer_flag=1001030101_): They helped design the beautiful icon and test this extension.
49 changes: 49 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Google Translate(PopClipExtension)

[English Version](https://github.com/wizyoung/googletranslate.popclipext/blob/master/README.md)

一个免费的谷歌翻译popclip插件,基于[Googletrans Python API](https://github.com/ssut/py-googletrans)[cocoaDialog](https://cocoadialog.com/)制作。

## 1. 预览

- 英译中

![](https://github.com/wizyoung/googletranslate.popclipext/blob/master/screenshots/en2cn.gif)

- 中译英

![](https://github.com/wizyoung/googletranslate.popclipext/blob/master/screenshots/cn2en.gif)

**右上角Bubble弹窗默认4秒后自动消失,若鼠标移动到Bubble内,则不会自动消失。**


## 2. 设置

- `Google Translate Site`: 要使用的谷歌翻译服务器。墙内的朋友请选择`translate.google.cn`,墙外的选择`translate.google.com`


- `Destination Language``Mother Language`: 目标外语和母语。程序将对划中的语言进行检测,若检测的语言非母语,则翻译为母语;若检测的语言为母语,则翻译为目标外语。


- `Output Window Location`:选择翻译结果是在右上角显示,还是屏幕中央弹窗显示。默认前者。

- 若勾选`Copy the results`每次翻译的结果将自动复制到剪贴板,默认该选项关闭。

![](https://github.com/wizyoung/googletranslate.popclipext/blob/master/screenshots/settings.png?raw=true)

- 若要后期更改设置,点击popclip下拉列表,再点击最下面的笔标记,会看到`Google Translate`插件右边有个齿轮图标,点击进去即可修改。


## 3. 安装

解压从 [Releases](https://github.com/wizyoung/googletranslate.popclipext/releases) 下载的文件,双击.popclipext点后缀文件即可完成安装。

## 4. TODO

- [ ] 翻译结果随鼠标显示在文字旁

## 5. 致谢

- [Googletrans Python API](https://github.com/ssut/py-googletrans): 一个免费的谷歌翻译第三方 Python API。
- [cocoaDialog](https://cocoadialog.com/): 简单通过命令行生成 macOS 对话框。
- [Turbo_祥](https://weibo.com/u/2627732300?topnav=1&wvr=6&topsug=1)[把那该死的球传给我](https://weibo.com/u/2282786300?refer_flag=1001030101_): 两位朋友帮我设计和修改了图标,并对扩展做了相应的测试。
File renamed without changes
File renamed without changes
Binary file added screenshots/settings.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 removed settings.png
Binary file not shown.
Loading

0 comments on commit f568ec2

Please sign in to comment.