Giter VIP home page Giter VIP logo

translationplugin's Introduction

TranslationPlugin TranslationPlugin

Jetbrains Plugins License Build Status GitHub release Version Downloads Financial Contributors on Open Collective

Translation plugin for IntelliJ based IDEs/Android Studio.

screenshots

Features

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

Compatibility:

  • Android Studio
  • AppCode
  • CLion
  • DataGrip
  • GoLand
  • IntelliJ IDEA Ultimate
  • IntelliJ IDEA Community
  • IntelliJ IDEA Educational
  • MPS
  • PhpStorm
  • PyCharm Professional
  • PyCharm Community
  • PyCharm Educational
  • Rider
  • RubyMine
  • WebStorm

Sponsors

JetBrains CodeStream

Installation

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

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

    • 下载插件包 -> Preferences(Settings) > Plugins > ⚙️ > Install plugin from disk... -> 选择插件包并安装(无需解压)

重启IDE.

Usage

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

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

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

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

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

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

  3. 开始翻译:

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

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

  4. 翻译并替换:

    翻译目标文本并将其替换。当翻译目标语言为英文时,会分别输出为骆驼式输出含单词分隔符输出(输出包含多个单词时,分隔符可在插件配置页面中配置:翻译设置 > 分隔符)和原输出

    用法:选择文本或者鼠标指向文本 > 单击鼠标右键 > Translate and Replace...(或者使用快捷键进行翻译,详见 Actions)。

  5. 切换翻译引擎:

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

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 Documentation

    翻译文档注释内容。默认显示在编辑器右键菜单上,光标在文档注释块内时可用。默认快捷键: (无)

  • Toggle Quick Documentation Translation

    快速文档中将文档内容在译文和原文之间切换。窗口聚焦于快速文档弹出窗或者文档工具窗口时可用。默认快捷键(同Translate):

    • Windows - Ctrl + Shift + Y
    • Mac OS - Control + Meta + U
  • Translate Text Component

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

    • Windows - Ctrl + Shift + Y
    • Mac OS - Control + Meta + U
  • Choose Translator

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

    • Windows - Ctrl + Shift + S
    • Mac OS - Control + Meta + Y
  • Word of the Day

    显示每日单词对话框。默认快捷键: (无)

  • 其他

    • 翻译对话框快捷键:

      • 显示源语言列表 - Alt + S
      • 显示目标语言列表 - Alt + T
      • 交换语言 - Alt + Shift + S
      • 切换窗口固定状态 - Alt + P
      • 播放TTS - Alt/Meta/Shift + Enter
      • 收藏到单词本 - Ctrl/Meta + F
      • 显示历史记录 - Ctrl/Meta + H
      • 拷贝译文 - Ctrl/Meta + Shift + C
      • 清空输入 - Ctrl/Meta + Shift + BackSpace/Delete
      • 展开更多翻译 - Ctrl/Meta + Down
      • 收起更多翻译 - Ctrl/Meta + UP
    • 翻译气泡快捷键:

      • 以对话框打开 - Ctrl + Shift + Y / Control + Meta + U
    • 快速文档窗口快捷键:

      • 开启/关闭自动翻译 - Ctrl + Shift + Y / Control + Meta + U

FAQ

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

    :请按照以下步骤操作以尝试解决问题。

    • 检查网络环境,确保网络畅通。
    • 检查是否是因为使用了代理软件而导致插件无法访问翻译API。
    • 检查IDE代理配置,查看是否是因为IDE代理配置导致的问题。
    • 如果使用的是谷歌翻译,请检查谷歌翻译配置。由于一些众所周知的原因,导致谷歌翻译的网络访问不是很稳定。如果无法访问,可以尝试切换使用translate.google.com选项的勾选状态后再进行翻译。另外,TTS功能使用的也是谷歌翻译的API。
  2. 翻译内容出现乱码怎么办?

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

    screenshots

  3. 无法保存应用密钥怎么办?

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

    • MacOS,请另阅 #81
    • Linux,请另阅 #115
  4. 快捷键不能使用怎么办?

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

Change Notes

v3.1.1 (2021-05-07)

  • 修复了一些错误

完整的更新历史记录

Support

您可以通过执行以下任意操作来贡献和支持此项目:

  • 在GitHub上标星

  • 将插件分享给您的小伙伴们

  • 提交PR

  • 反馈问题

  • 提出您的想法/建议

  • 如果您喜欢这个插件,请考虑捐赠以维持插件的相关活动:

    Open Collective 支付宝 微信支付
    OpenCollective Alipay WechatPlay
    使用支付宝/微信支付捐赠后请留言或者通过邮件提供您的名字/昵称和网站,格式为:

    名字/昵称 [<网站>][:留言](网站与留言为可选部分,例子:Yii.Guxing <github.com/YiiGuxing>:加油!

    您提供的名字、网站和捐赠总额将会被添加到捐赠者列表中。

    邮箱地址:[email protected] (点击发送邮件)

感谢您的支持!

More Plugins

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

捐赠者

姓名 网站 捐赠总额
唐嘉 github.com/qq1427998646 100 CNY
凌高 100 CNY
三分醉 www.sanfenzui.com 88 CNY
LeeWyatt github.com/leewyatt 76.6 CNY
Him188 github.com/him188 66 CNY
一个李大壮罢了 50 CNY
Songc www.zdone.com 50 CNY
Wangyangisgood 50 CNY
Pandeng github.com/jiafeimao-gjf 50 CNY
堂哥 codertang.com 50 CNY
永夜 github.com/cn-src 50 CNY

更多捐赠者

translationplugin's People

Contributors

yiiguxing avatar niktrop avatar d-w-x avatar monkeywithacupcake avatar julia-alexandrova avatar kaiattrib 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.