All Projects → huangkefen → web-translate

huangkefen / web-translate

Licence: other
支持pdf和web的双击划词翻译脚本,当前使用爱词霸公共api

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to web-translate

Alfred Parrot
📝 一款可以多种语言翻译的 Alfred Workflow
Stars: ✭ 89 (+106.98%)
Mutual labels:  translate, youdao, chinese-translation
kictor
A dictionary based on the console, 一个基于控制台的词典工具
Stars: ✭ 15 (-65.12%)
Mutual labels:  translate, youdao, iciba
terminal-translate
a terminal-translate tool
Stars: ✭ 73 (+69.77%)
Mutual labels:  translate, youdao, iciba
MrTranslator
📘MrTranslator-A Translation Android APP
Stars: ✭ 16 (-62.79%)
Mutual labels:  translate, youdao
Ydict
Yet another command-line youdao dictionary for geeks!
Stars: ✭ 318 (+639.53%)
Mutual labels:  translate, youdao
Many-Translaters
谷歌翻译,360翻译,iCIBA翻译,有道翻译,免费API
Stars: ✭ 121 (+181.4%)
Mutual labels:  youdao, iciba
gdict
A command line dictionary written in golang powered by multi engines.
Stars: ✭ 21 (-51.16%)
Mutual labels:  youdao, iciba
Chrome Extension Udemy Translate
Translate Udemy's subtitles into Chinese、English etc(Disneyplus+netflix+udemy+lynda+hulu+hbo now+primevideo)
Stars: ✭ 553 (+1186.05%)
Mutual labels:  translate, youdao
Translators
🌏🌍🌎Translators🌎🌍🌏 is a library which aims to bring free, multiple, enjoyable translation to individuals and students in Python. Translators是一个旨在用Python为个人和学生带来免费、多样、愉快翻译的库。
Stars: ✭ 295 (+586.05%)
Mutual labels:  translate, youdao
Mtrans
Multi-source Translation
Stars: ✭ 711 (+1553.49%)
Mutual labels:  translate, youdao
Logback Chinese Manual
logback 中文手册/文档。
Stars: ✭ 138 (+220.93%)
Mutual labels:  translate, chinese-translation
Dict
Chinese and English translation tools in the command line(命令行下中英文翻译工具)
Stars: ✭ 243 (+465.12%)
Mutual labels:  translate, youdao
Chrome Extensions Youdaowithwordnode
有道词典chrome划词插件,原版不带生词本,在其源码基础上,添加了添加生词本的功能,生词本用的有道官方API
Stars: ✭ 74 (+72.09%)
Mutual labels:  translate, youdao
AlfredWorkflow YoudaoTranslate
alfred workflow,有道翻译
Stars: ✭ 20 (-53.49%)
Mutual labels:  translate, youdao
awesome-malware-analysis
Defund the Police.
Stars: ✭ 9,181 (+21251.16%)
Mutual labels:  chinese-translation
high-frequency-vocabulary
30,000 most common English words with Chinese dictionary explanations in order of frequency.
Stars: ✭ 98 (+127.91%)
Mutual labels:  chinese-translation
translate english
Java程序员阅读源码必知英语单词
Stars: ✭ 24 (-44.19%)
Mutual labels:  translate
awesome-nodejs
Node.js 资源大全中文版。An awesome Node.js packages and resources
Stars: ✭ 978 (+2174.42%)
Mutual labels:  chinese-translation
vue-translated
Internationalization (i18n) and localization (l10n) library for Vue.js v2.
Stars: ✭ 19 (-55.81%)
Mutual labels:  translate
translate-go
https://babyblue94520.github.io/translate-go/dist/
Stars: ✭ 14 (-67.44%)
Mutual labels:  translate

1 关于

  • 双击划词翻译,浏览器脚本插件,支持PDF和普通网页.
  • 使用国内优秀翻译软件iCIBA的即划即译功能,并使用了优秀的开源项目PDF.js
  • firefox扩展: Web-Translate-firefox
  • chrome扩展: Web-Translate-chrome
  • 2018/06/12 功能更新: 添加右键打开本地PDF的功能,支持Chrome和Firefox,自动加载取词脚本
  • 2018/08/09 公告通知: Firefox 60 及以上版本对安全漏洞 CVE-2018-5158进行了修复,所以当前已无法匹配file:///*.pdf,无法成功加载取词脚本,请暂时使用右键的"打开本地PDF"功能替代。

2 功能特性

  1. 双击或划译取词.
  2. 右键打开本地PDF并自动加载取词插件。
  3. 支持普通网页的双击划译,翻译弹窗可固定。
  4. 支持自定义任意页面的css样式,比如PDF页面背景色更改,默认苹果绿。
  5. 支持发音(firefox和chrome)。
  6. 简洁但强大的配置页面。
  7. 右键动态加载取词脚本。
  8. 强大的url正则匹配功能。
  9. 持续迭代更新
  10. 跨平台,浏览器+扩展。(针对日常使用Linux的朋友)。

3 扩展使用说明

  1. 安装Web-Translate-firefoxWeb-Translate-chrome
  2. 右键可进入配置页面,也可动态加载取词脚本
  3. 配置页面中添加url规则,用空格分开规则和注释(可为空),点击保存即可.格式为 规则+空格+注释,例子如下
  4. 例如"://.github.com/* 匹配所有github.com页面" (去掉双引号)
  5. 使用换行符分开多条规则.
  6. 如果你删除了所有规则,再点击一次"保存"按钮,就会出现"恢复默认"按钮,可恢复默认配置.
  7. PDF模式和WEB模式的配置,留空白并点击保存按钮将恢复默认.

4 URL匹配规则(重要)

参考 match_patterns_360match_patterns_Mozillamatch_patterns_Google

5 JS版本使用说明

  1. 安装浏览器插件,violentmonkey(暴力猴) 或者 greasemonkey(油猴子) 或者 tampermonkey(捣蛋猴)
  2. 推荐火狐,因为火狐默认使用PDF.js加载本地PDF。
  3. 推荐插件violentmonkey,向下兼容,图标好看,界面简洁.
  4. 插件安装后,新建脚本,然后把js文件里的代码全部粘贴进去,保存。
  5. 按需修改url匹配模式,即可正常使用.
  6. 建议安装firefox和chrome扩展使用

在js代码的开头有一行注释是:

// @match *://*/* 

以上这个匹配模式是匹配所有url网页.
也许你并不像这么做,比如你只想匹配本地打开的pdf,则可以改成:

 // @match file:///*/*.pdf 

你还可以额外指定包含和排除模式,比如:

// @include  https://wiki.greasespot.net/*  
// @include  http://mozilla.github.io/pdf.js/web/viewer.html    
// @include /^(http|https)://en\.people\.cn//   
// @exclude  https://github.com/*
  • js版的模式匹配可参考:include_and_exclude_rules 或者 tampermonkey-documentation
  • chrome下不支持本地pdf,因为无法匹配chrome-extension开头的地址.(chrome目前不允许匹配插件地址)
  • chrome下发音的问题已于2017/11/14通过修改发音代码解决,现可完美发音,无需flash支持,请更新脚本代码.
  • sarabander 该网页存在较严格的代码审查,iciba官方的一些代码无法通过校验,因此在该网页上无法正常加载.
  • github.com  未经github签名的脚本会被拒绝注入,并且安全策略不允许跨域访问,因此也无法正常加载.
  • 后续有时间会写成firefox和chrome的扩展,这样就可以解决以上这些棘手的问题了.

6 Why

初衷:

  • Linux下阅读PDF英文文档不方便,
  • goldendict非常不错,但却不支持foxitpdf的双击取词翻译。
  • youdao dict ,只支持Debian系,浏览英文文档时我感觉也不大好用。
  • 尚未发现一款能让我满意的英文文档阅读工具(Linux下,并且对中文翻译有良好支持)。
  • 自己动手,丰衣足食.
  • 方便自己,方便他人.

问:js版为什么在代码中嵌入jquery?
答:主要是为了避免脚本冲突以及重复加载,避免对原网站造成干扰。

7 截图效果

↓↓↓ 在firefox下浏览本地pdf 以及 在chrome下浏览普通网页 ↓↓↓

view1    

view2  

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].