Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/dev-2.x'
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle.properties
  • Loading branch information
YiiGuxing committed May 16, 2020
2 parents 2fc3ab6 + 06cd5f4 commit 7d5118e
Show file tree
Hide file tree
Showing 41 changed files with 515 additions and 124 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## [v2.9.0](https://github.com/YiiGuxing/TranslationPlugin/tree/v2.8.1) (2020-05-16)

- 增加了对 *Quick Documentation* 的翻译的支持(感谢 [Nikolay Tropin](https://github.com/niktrop)
- 单词本支持导出为txt文本(感谢 [Kaiattrib](https://github.com/kaiattrib)

- 修复了一些Bug
## [v2.8.1](https://github.com/YiiGuxing/TranslationPlugin/tree/v2.8.1) (2020-04-07)

- 修复了一些Bug
Expand Down
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ TranslationPlugin
点击状态栏的翻译引擎状态图标或者使用快捷键 <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>S</kbd>(Mac OS: <kbd>Control</kbd> + <kbd>Meta</kbd> + <kbd>Y</kbd>)可以快速切换翻译引擎,目前有谷歌翻译、有道翻译和百度翻译。


插件配置
------

![settings](./images/settings.png)


Actions
-------
- **Show Translation Dialog...**
Expand Down Expand Up @@ -178,9 +172,10 @@ FAQ
更新日志
--------

## [v2.8.1](https://github.com/YiiGuxing/TranslationPlugin/tree/v2.8.1) (2020-04-07)
## [v2.9.0](https://github.com/YiiGuxing/TranslationPlugin/tree/v2.8.1) (2020-05-16)

- 修复了一些Bug
- 增加了对 *Quick Documentation* 的翻译的支持(感谢 [Nikolay Tropin](https://github.com/niktrop)
- 单词本支持导出为txt文本(感谢 [Kaiattrib](https://github.com/kaiattrib)

[完整的更新历史记录](./CHANGELOG.md)

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ buildscript {

plugins {
// https://github.com/JetBrains/gradle-intellij-plugin
id "org.jetbrains.intellij" version "0.4.16"
id 'org.jetbrains.kotlin.jvm' version '1.3.70'
id "org.jetbrains.intellij" version "0.4.20"
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
}

repositories {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# suppress inspection "UnusedProperty" for whole file
version=2.8.1
version=2.9.0-192
buildNumber=
#buildNumber=SNAPSHOT
ideaVersion=IU-2017.1
Expand All @@ -9,6 +9,6 @@ kotlinLanguageVersion=1.3
kotlinTargetVersion=1.1
sources=false
customSinceBuild=171
customUntilBuild=201.*
customUntilBuild=192.*
kotlin.code.style=official
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
43 changes: 25 additions & 18 deletions src/main/java/cn/yiiguxing/plugin/translate/ui/form/Settings.form
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<grid id="27dc6" binding="mWholePanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="732" height="634"/>
<xy x="20" y="20" width="732" height="697"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="4d915" layout-manager="GridLayoutManager" row-count="7" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="4d915" layout-manager="GridLayoutManager" row-count="8" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
Expand All @@ -18,14 +18,13 @@
<children>
<vspacer id="aaf4">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="d72d6" class="cn.yiiguxing.plugin.translate.ui.settings.TranslatorSettingsContainer" binding="mTransPanelContainer" custom-create="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<grid id="197b" binding="mTranslateSettingsPanel" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
Expand Down Expand Up @@ -162,7 +161,7 @@
<grid id="3d66b" binding="mFontPanel" layout-manager="GridLayoutManager" row-count="3" column-count="5" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
Expand Down Expand Up @@ -252,7 +251,7 @@
<grid id="d1cc4" binding="mHistoryPanel" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
Expand Down Expand Up @@ -297,57 +296,57 @@
</component>
</children>
</grid>
<grid id="4114f" binding="mOptionsPanel" layout-manager="GridLayoutManager" row-count="9" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="4114f" binding="mOptionsPanel" layout-manager="GridLayoutManager" row-count="10" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="aa0d7" class="com.intellij.ui.components.JBCheckBox" binding="mShowStatusIconCheckBox">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/TranslationBundle" key="settings.options.showStatusBarIcon"/>
</properties>
</component>
<component id="7f941" class="com.intellij.ui.components.JBCheckBox" binding="mFoldOriginalCheckBox">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/TranslationBundle" key="settings.options.foldOriginal"/>
</properties>
</component>
<component id="3b376" class="com.intellij.ui.components.JBCheckBox" binding="mKeepFormatCheckBox">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/TranslationBundle" key="settings.options.keepFormat"/>
</properties>
</component>
<component id="96c1" class="com.intellij.ui.components.JBCheckBox" binding="mAutoReplaceCheckBox">
<constraints>
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="9" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/TranslationBundle" key="settings.options.autoReplace"/>
</properties>
</component>
<component id="e3492" class="com.intellij.ui.components.JBCheckBox" binding="mShowWordFormsCheckBox">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/TranslationBundle" key="settings.options.showWordForms"/>
</properties>
</component>
<component id="6538d" class="com.intellij.ui.components.JBCheckBox" binding="mSelectTargetLanguageCheckBox">
<constraints>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/TranslationBundle" key="settings.options.selectLanguage"/>
Expand All @@ -356,7 +355,7 @@
<grid id="14d2" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="4" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
Expand Down Expand Up @@ -386,26 +385,34 @@
</grid>
<component id="61460" class="com.intellij.ui.components.JBCheckBox" binding="mShowWordsOnStartupCheckBox">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/TranslationBundle" key="settings.options.showWordsOnStartup"/>
</properties>
</component>
<component id="437ac" class="com.intellij.ui.components.JBCheckBox" binding="mShowExplanationCheckBox">
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/TranslationBundle" key="settings.options.showExplanation"/>
</properties>
</component>
<component id="c8327" class="com.intellij.ui.components.JBCheckBox" binding="mTranslateDocumentationCheckBox">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/TranslationBundle" key="settings.options.translate.documentation"/>
</properties>
</component>
</children>
</grid>
<grid id="a748d" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="20" left="0" bottom="0" right="0"/>
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class SettingsForm {
private JLabel mPhoneticFontLabel;
private TranslatorSettingsContainer mTransPanelContainer;
private JPanel mOptionsPanel;
private JBCheckBox mTranslateDocumentationCheckBox;
private JBCheckBox mShowStatusIconCheckBox;
private JBCheckBox mFoldOriginalCheckBox;
private JBCheckBox mKeepFormatCheckBox;
Expand Down Expand Up @@ -276,4 +277,8 @@ public final JBCheckBox getSelectTargetLanguageCheckBox() {
public final LinkLabel getSupportLinkLabel() {
return mSupportLinkLabel;
}

public JBCheckBox getTranslateDocumentationCheckBox() {
return mTranslateDocumentationCheckBox;
}
}
2 changes: 2 additions & 0 deletions src/main/kotlin/cn/yiiguxing/plugin/translate/Settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ class Settings : PersistentStateComponent<Settings> {
*/
var targetLanguageSelection: TargetLanguageSelection = TargetLanguageSelection.DEFAULT

var translateDocumentation: Boolean = true

@Transient
private val settingsChangePublisher: SettingsChangeListener =
ApplicationManager.getApplication().messageBus.syncPublisher(SettingsChangeListener.TOPIC)
Expand Down
Loading

0 comments on commit 7d5118e

Please sign in to comment.