V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
nosugar
V2EX  ›  程序员

​ 274 行集:必应、谷歌、有道、百度划词翻译脚本,你又可以删掉一个扩展了 chrome&firefox

  •  
  •   nosugar · 2017-10-23 08:18:56 +08:00 · 5649 次点击
    这是一个创建于 2348 天前的主题,其中的信息可能已经有所发展或是发生改变。

    一个比较实用的划词翻译脚本

    效果还不错 https://github.com/barrer/tampermonkey-script/blob/master/translate/translate.gif

    脚本 https://github.com/barrer/tampermonkey-script/tree/master/translate

    安装 https://github.com/barrer/tampermonkey-script/blob/master/README.md

    自用还是够用的,有个人定制需求的 fork 后自己改改,根据具体情况再决定是否 push 到主分支,代码以简单实用为主,欢迎大佬改进!👏

    第 1 条附言  ·  2017-10-23 15:32:22 +08:00
    后面改了一些 bug 可能稍微多于 274 行
    第 2 条附言  ·  2018-01-02 18:39:10 +08:00
    重构了下,有发音了,兼容性很好
    21 条回复    2018-01-02 18:40:24 +08:00
    andawp
        1
    andawp  
       2017-10-23 08:34:16 +08:00   ❤️ 1
    换成 mouseover 事件,感觉方便些
    anyclue
        2
    anyclue  
       2017-10-23 08:38:30 +08:00   ❤️ 2
    加个朗读发音我就换了
    xiaotianhu
        3
    xiaotianhu  
       2017-10-23 09:46:37 +08:00
    希望有 safari 版本...
    mac safari 还是好用 就是缺个这个插件...
    BearD01001
        4
    BearD01001  
       2017-10-23 10:01:44 +08:00
    @anyclue #2 加个朗读发音我就换了 +1
    muren
        5
    muren  
       2017-10-23 10:06:34 +08:00
    还得去点一下,差评
    Mitt
        6
    Mitt  
       2017-10-23 10:16:10 +08:00
    mouseover 和自动翻译都有个问题。。。mouseover 算法不好会导致性能问题, 自动翻译的话比如我这种手残党,喜欢没事就划几个字高亮一下 (>﹏<)
    guonning
        7
    guonning  
       2017-10-23 10:19:21 +08:00 via Android
    最近用百度翻译,挺好用
    CuminLo
        8
    CuminLo  
       2017-10-23 10:29:08 +08:00   ❤️ 2
    可以加发音么?

    现在用的是 https://greasyfork.org/en/scripts/12758-youdaodict 这个,主要就是有发音功能....
    kingboy9525
        9
    kingboy9525  
       2017-10-23 10:36:48 +08:00
    @CuminLo #8 感谢推荐,这个脚本不错~
    kingboy9525
        10
    kingboy9525  
       2017-10-23 10:39:30 +08:00
    加上发音就完美了~另外色调和字体可以考虑调一下。例如橙色可以稍微淡一点
    YzSama
        11
    YzSama  
       2017-10-23 11:37:49 +08:00
    @CuminLo #8 已装。比较常用的是谷歌插件 划词翻译
    liweicomeon
        12
    liweicomeon  
       2017-10-23 12:11:58 +08:00   ❤️ 1
    https://github.com/Selection-Translator/crx-selection-translate

    我觉得这个很好用,包含所有接口,有发音
    kookxiang
        13
    kookxiang  
       2017-10-23 12:33:49 +08:00
    扩展性能和方便程度都比脚本好很多
    505243267
        14
    505243267  
       2017-10-23 12:36:55 +08:00 via iPad
    @xiaotianhu 这是个 tampermonkey 脚本,safari 去 https://tampermonkey.net 下载插件后即可安装脚本。
    Haiwx
        15
    Haiwx  
       2017-10-23 12:44:37 +08:00
    nosmile
        16
    nosmile  
       2017-10-23 14:08:30 +08:00
    自用的 google 翻译,可以满足基本需要
    nosugar
        17
    nosugar  
    OP
       2017-10-23 15:33:13 +08:00
    @andawp moseover 太耗 cpu 啦
    nosugar
        18
    nosugar  
    OP
       2017-10-23 15:34:27 +08:00
    @anyclue
    @BearD01001
    @CuminLo
    @kingboy9525
    发音考虑的兼容 http、https,看看后续有没有大佬贡献代码
    cye3s
        19
    cye3s  
       2017-10-23 16:38:41 +08:00
    我在用这个,主要是可以设置开关,不会默认打开取词
    https://github.com/HalfdogStudio/youdaodict
    anson2416
        20
    anson2416  
       2017-10-23 23:14:10 +08:00
    @cye3s 安装了之后,怎样才能触发翻译啊?插件已经打开。
    nosugar
        21
    nosugar  
    OP
       2018-01-02 18:40:24 +08:00
    @anyclue
    @xiaotianhu
    @BearD01001
    @CuminLo
    @YzSama
    @liweicomeon
    @kookxiang
    @Haiwx
    @nosmile
    @cye3s
    @anson2416

    重构了下,有发音了,兼容性很好
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2835 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 15:24 · PVG 23:24 · LAX 08:24 · JFK 11:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.