Giter Club home page Giter Club logo

translationplugin's Introduction

TranslationPlugin

Jetbrains Plugins License Build Status GitHub release Version Downloads

JetBrains IDE/Android Studio 翻译插件

screenshots

特征

  • 多翻译引擎
    • Google翻译
    • 有道翻译
    • 百度翻译
  • 多语言互译
  • 语音朗读
  • 自动选词
  • 自动单词拆分

兼容除 MPS 外所有产品编译号为143以上的 Jetbrains IDE 产品。
支持的 IDE:

  • Android Studio
  • IntelliJ IDEA
  • IntelliJ IDEA Community Edition
  • PhpStorm
  • WebStorm
  • PyCharm
  • PyCharm Community Edition
  • RubyMine
  • AppCode
  • CLion
  • DataGrip
  • Rider

安装

  • 使用 IDE 内置插件系统安装:

    • Preferences(Settings) > Plugins > Browse repositories... > 搜索并找到"Translation" > Install Plugin
  • 手动安装:

重启IDE.

使用

  1. 申请有道智云翻译服务(可选):

    • 注册有道智云帐号并获取其应用ID应用密钥
    • 绑定应用ID应用密钥Preferences(Settings) > [Other Settings] > Translation > 有道翻译

    注:请注意保管好你的应用密钥,防止其泄露。如帐号欠费,将无法使用。

  2. 申请百度翻译服务(可选):

    • 注册百度翻译开放平台帐号并获取其应用ID应用密钥
    • 绑定应用ID应用密钥Preferences(Settings) > [Other Settings] > Translation > 百度翻译

    注:请注意保管好你的应用密钥,防止其泄露。如帐号欠费,将无法使用。

  3. 开始翻译:

    选择文本或者鼠标指向文本 > 单击鼠标右键 > Translate

    或者使用快捷键进行翻译,详见 Actions

  4. 切换翻译引擎:

    点击状态栏的翻译引擎状态图标或者使用快捷键 Ctrl + Shift + S(Mac OS: Control + Meta + Y)可以快速切换翻译引擎,目前有谷歌翻译、有道翻译和百度翻译。

插件配置

settings

Actions

  • Show Translation Dialog...

    打开翻译对话框。默认显示在工具栏上。默认快捷键:

    • Windows - Ctrl + Shift + O
    • Mac OS - Control + Meta + I
  • Translate

    取词并翻译。如果有已选择的文本,优先从选择的文本内取词,否则默认以最大范围自动取词(该取词模式可在Settings中配置)。默认显示在编辑器右键菜单上,默认快捷键:

    • Windows - Ctrl + Shift + Y
    • Mac OS - Control + Meta + U
  • Translate(Inclusive)

    取词并翻译。自动以最大范围取最近的所有词,忽略手动选择的文本。默认快捷键: (无)

  • Translate(Exclusive)

    取词并翻译。自动取最近的单个词,忽略手动选择的文本。默认快捷键: (无)

  • Translate and Replace...

    翻译并替换。取词方式同Translate操作。默认显示在编辑器右键菜单上,默认快捷键:

    • Windows - Ctrl + Shift + X
    • Mac OS - Control + Meta + O
  • Translate Text Component

    翻译一些文本组件(如快速文档、提示气泡、输入框……)中选中的文本,不支持自动取词。默认快捷键:

    • Windows - Ctrl + Shift + O
    • Mac OS - Control + Meta + I
  • Choose Translator

    快速切换翻译引擎。默认快捷键:

    • Windows - Ctrl + Shift + S
    • Mac OS - Control + Meta + Y

FAQ

  1. 翻译内容出现乱码怎么办?

    :出现乱码一般是因为字体中没有相应的字符的问题,可以到插件的设置页面修改字体以解决乱码问题(如下图所示)。

    screenshots

  2. 出现网络错误或者网络连接超时怎么办?

    • 检查网络环境,确保网络畅通。
    • 检查是否是因为使用了代理软件而导致插件无法访问翻译API。
    • 检查IDE代理配置,查看是否是因为IDE代理配置导致的问题。
    • 如果使用的是谷歌翻译,检查谷歌翻译配置,查看是否勾选了使用translate.google.com选项(如果系统语言环境是非中文的话,此选项是默认勾选的),translate.google.com在国内是需要VPN才能访问的。另外,TTS功能使用的也是谷歌翻译的API。
  3. MacOS、Linux下无法保存应用密钥,出现校验签名失败?

    :可以尝试将密码保存方式改成In KeePass方式 (Settings > Appearance & Behavior > System Settings > Passwords),原因与细节:

    • MacOS,请另阅 #81
    • Linux,请另阅 #115
  4. 为什么2.0以前的版本快捷键在新版本都不能用了?

    :由于2.0以前的版本的快捷键大多与IDE默认的快捷键有冲突,抢占了IDE的默认快捷键。所以,从2.0版本以后,重新设置了插件的默认快捷键,而2.0以前的版本的快捷键已被废弃。

  5. 快捷键不能使用怎么办?

    :快捷键不能使用可能是因为被其他插件或者外部应用占用了,可以为相应的操作重新设置新的快捷键。

更新日志

v2.3.8 (2019-07-30)

  • 修复翻译长文本时显示不全的问题

完整的更新历史记录

Support

您可以通过以下操作为项目提供支持:

  • 在GitHub上Star此项目

  • 将插件分享给您的朋友/同事

  • 提交PR

  • 反馈问题

  • 提出您的建议

  • 通过Open Collective捐赠

  • 通过支付宝或微信捐赠

    支付宝 微信

感谢您的支持!

其他插件

translationplugin's People

Contributors

yiiguxing avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.