• 请不要在回答技术问题时复制粘贴 AI 生成的内容
nosugar
V2EX  ›  程序员

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

  •  
  •   nosugar · Oct 23, 2017 · 6573 views
    This topic created in 3150 days ago, the information mentioned may be changed or developed.

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

    效果还不错 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 到主分支,代码以简单实用为主,欢迎大佬改进!👏

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

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

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

    重构了下,有发音了,兼容性很好
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4796 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 92ms · UTC 05:38 · PVG 13:38 · LAX 22:38 · JFK 01:38
    ♥ Do have faith in what you're doing.