diff --git a/gradle.properties b/gradle.properties
index 85dd6a03b..a69472d1a 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,11 +4,11 @@ kotlin.code.style=official
pluginGroup = spp.jetbrains
pluginName = Source++
-projectVersion=0.4.5
+projectVersion=0.4.6
pluginSinceBuild = 202.4357
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
# See https://jb.gg/intellij-platform-builds-list for available build versions
-pluginVerifierIdeVersions = 2020.3.2, 2021.3.3
+pluginVerifierIdeVersions = 2020.2.4, 2021.3.3
platformType = IC
ideVersion = 2021.3.3
@@ -22,7 +22,7 @@ platformPlugins = java, Groovy, Kotlin, PythonCore:213.5744.223, org.intellij.sc
kotlin.stdlib.default.dependency = true
apolloVersion=3.2.0
-vertxVersion=4.2.4
+vertxVersion=4.2.6
slf4jVersion=1.7.33
jacksonVersion=2.13.1
joorVersion=0.9.13
diff --git a/plugin/src/main/java/spp/jetbrains/sourcemarker/PluginUI.java b/plugin/src/main/java/spp/jetbrains/sourcemarker/PluginUI.java
index 2019372ba..5fa11acd3 100644
--- a/plugin/src/main/java/spp/jetbrains/sourcemarker/PluginUI.java
+++ b/plugin/src/main/java/spp/jetbrains/sourcemarker/PluginUI.java
@@ -1,6 +1,5 @@
package spp.jetbrains.sourcemarker;
-import com.intellij.DynamicBundle;
import com.intellij.ui.Gray;
import com.intellij.ui.JBColor;
import com.intellij.util.ui.UIUtil;
@@ -42,10 +41,10 @@ public class PluginUI {
}
}
- public static final Font BIG_FONT = (DynamicBundle.getLocale().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_16 : ROBOTO_LIGHT_PLAIN_17;
- public static final Font SMALL_FONT = (DynamicBundle.getLocale().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_15 : ROBOTO_LIGHT_PLAIN_16;
- public static final Font SMALLER_FONT = (DynamicBundle.getLocale().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_14 : ROBOTO_LIGHT_PLAIN_15;
- public static final Font SMALLEST_FONT = (DynamicBundle.getLocale().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_13 : ROBOTO_LIGHT_PLAIN_14;
+ public static final Font BIG_FONT = (PluginBundle.INSTANCE.getLOCALE().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_16 : ROBOTO_LIGHT_PLAIN_17;
+ public static final Font SMALL_FONT = (PluginBundle.INSTANCE.getLOCALE().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_15 : ROBOTO_LIGHT_PLAIN_16;
+ public static final Font SMALLER_FONT = (PluginBundle.INSTANCE.getLOCALE().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_14 : ROBOTO_LIGHT_PLAIN_15;
+ public static final Font SMALLEST_FONT = (PluginBundle.INSTANCE.getLOCALE().getLanguage().equals("zh")) ? MICROSOFT_YAHEI_PLAIN_13 : ROBOTO_LIGHT_PLAIN_14;
public static final Color PANEL_BACKGROUND_COLOR = Gray._37;
public static final Color LABEL_FOREGROUND_COLOR = new Color(152, 118, 170);
public static final Color LABEL_FOREGROUND_COLOR1 = new Color(106, 135, 89);
@@ -69,6 +68,6 @@ public static String getCommandHighlightColor() {
}
public static Color getEditCompleteColor() {
- return UIUtil.getWindowColor();//Color.decode("#2B2B2B");
+ return UIUtil.getWindowColor();
}
}
diff --git a/plugin/src/main/java/spp/jetbrains/sourcemarker/settings/PluginConfigurationPanel.form b/plugin/src/main/java/spp/jetbrains/sourcemarker/settings/PluginConfigurationPanel.form
index 6cf92fd10..1a8e100e1 100644
--- a/plugin/src/main/java/spp/jetbrains/sourcemarker/settings/PluginConfigurationPanel.form
+++ b/plugin/src/main/java/spp/jetbrains/sourcemarker/settings/PluginConfigurationPanel.form
@@ -37,7 +37,7 @@
-
+
@@ -56,7 +56,7 @@
-
+
@@ -74,7 +74,7 @@
-
+
@@ -92,7 +92,7 @@
-
+
@@ -109,7 +109,7 @@
-
+
@@ -125,7 +125,7 @@
-
+
@@ -141,7 +141,7 @@
-
+
diff --git a/plugin/src/main/java/spp/jetbrains/sourcemarker/settings/PluginConfigurationPanel.java b/plugin/src/main/java/spp/jetbrains/sourcemarker/settings/PluginConfigurationPanel.java
index 15ff6525a..b6d988cbc 100644
--- a/plugin/src/main/java/spp/jetbrains/sourcemarker/settings/PluginConfigurationPanel.java
+++ b/plugin/src/main/java/spp/jetbrains/sourcemarker/settings/PluginConfigurationPanel.java
@@ -29,7 +29,7 @@ public class PluginConfigurationPanel {
private JPanel myGlobalSettingsPanel;
private JTextField rootSourcePackageTextField;
private JCheckBox autoResolveEndpointNamesCheckBox;
- private JCheckBox consoleCheckBox;
+ private JCheckBox debugConsoleCheckBox;
private JPanel myServiceSettingsPanel;
private JTextField serviceHostTextField;
private JTextField accessTokenTextField;
@@ -37,7 +37,12 @@ public class PluginConfigurationPanel {
private JComboBox serviceComboBox;
private JCheckBox verifyHostCheckBox;
private JLabel verifyHostLabel;
- private JCheckBox autoDisplayEndpointQuickStatCheckBox;
+ private JCheckBox autoDisplayEndpointQuickStatsCheckBox;
+ private JLabel hostLabel;
+ private JLabel accessTokenLabel;
+ private JLabel certificatePinsLabel;
+ private JLabel serviceLabel;
+ private JLabel rootSourcePackageLabel;
private SourceMarkerConfig config;
private CertificatePinPanel myCertificatePins;
@@ -59,6 +64,17 @@ public PluginConfigurationPanel(SourceMarkerConfig config) {
}
});
}
+
+ //todo: shouldn't need to manually update locale text
+ hostLabel.setText(message("service_host"));
+ accessTokenLabel.setText(message("access_token"));
+ verifyHostLabel.setText(message("verify_host"));
+ certificatePinsLabel.setText(message("certificate_pins"));
+ serviceLabel.setText(message("service"));
+ rootSourcePackageLabel.setText(message("root_source_package"));
+ debugConsoleCheckBox.setText(message("debug_console"));
+ autoResolveEndpointNamesCheckBox.setText(message("auto_resolve_endpoint_names"));
+ autoDisplayEndpointQuickStatsCheckBox.setText(message("auto_display_endpoint_quick_stats"));
}
public JComponent getContentPane() {
@@ -72,7 +88,7 @@ boolean isModified() {
if (!Objects.equals(autoResolveEndpointNamesCheckBox.isSelected(), config.getAutoResolveEndpointNames())) {
return true;
}
- if (!Objects.equals(consoleCheckBox.isSelected(), config.getPluginConsoleEnabled())) {
+ if (!Objects.equals(debugConsoleCheckBox.isSelected(), config.getPluginConsoleEnabled())) {
return true;
}
if (!Objects.equals(serviceHostTextField.getText(), config.getServiceHost())) {
@@ -90,7 +106,7 @@ boolean isModified() {
if (!Objects.equals(serviceComboBox.getSelectedItem(), config.getServiceName())) {
return config.getServiceName() != null || serviceComboBox.getSelectedItem() != "All Services";
}
- if (!Objects.equals(autoDisplayEndpointQuickStatCheckBox.isSelected(), config.getAutoDisplayEndpointQuickStats())) {
+ if (!Objects.equals(autoDisplayEndpointQuickStatsCheckBox.isSelected(), config.getAutoDisplayEndpointQuickStats())) {
return true;
}
return false;
@@ -106,14 +122,14 @@ public SourceMarkerConfig getPluginConfig() {
Arrays.stream(rootSourcePackageTextField.getText().split(","))
.map(String::trim).collect(Collectors.toList()),
autoResolveEndpointNamesCheckBox.isSelected(),
- true, consoleCheckBox.isSelected(),
+ true, debugConsoleCheckBox.isSelected(),
serviceHostTextField.getText(),
accessTokenTextField.getText(),
new ArrayList<>(Collections.list(myCertificatePins.listModel.elements())),
null,
verifyHostCheckBox.isSelected(),
currentService,
- autoDisplayEndpointQuickStatCheckBox.isSelected()
+ autoDisplayEndpointQuickStatsCheckBox.isSelected()
);
}
@@ -121,11 +137,11 @@ public void applySourceMarkerConfig(SourceMarkerConfig config) {
this.config = config;
rootSourcePackageTextField.setText(String.join(",", config.getRootSourcePackages()));
autoResolveEndpointNamesCheckBox.setSelected(config.getAutoResolveEndpointNames());
- consoleCheckBox.setSelected(config.getPluginConsoleEnabled());
+ debugConsoleCheckBox.setSelected(config.getPluginConsoleEnabled());
serviceHostTextField.setText(config.getServiceHost());
accessTokenTextField.setText(config.getAccessToken());
verifyHostCheckBox.setSelected(config.getVerifyHost());
- autoDisplayEndpointQuickStatCheckBox.setSelected(config.getAutoDisplayEndpointQuickStats());
+ autoDisplayEndpointQuickStatsCheckBox.setSelected(config.getAutoDisplayEndpointQuickStats());
myCertificatePins = new CertificatePinPanel();
myCertificatePins.listModel.addAll(config.getCertificatePins());
diff --git a/plugin/src/main/kotlin/spp/jetbrains/sourcemarker/PluginBundle.kt b/plugin/src/main/kotlin/spp/jetbrains/sourcemarker/PluginBundle.kt
index e94854a94..3b1ddb6f4 100644
--- a/plugin/src/main/kotlin/spp/jetbrains/sourcemarker/PluginBundle.kt
+++ b/plugin/src/main/kotlin/spp/jetbrains/sourcemarker/PluginBundle.kt
@@ -18,7 +18,8 @@
package spp.jetbrains.sourcemarker
import com.intellij.AbstractBundle
-import com.intellij.DynamicBundle
+import com.intellij.ide.plugins.PluginManager
+import com.intellij.openapi.extensions.PluginId
import org.jetbrains.annotations.NonNls
import org.jetbrains.annotations.PropertyKey
import java.util.*
@@ -34,9 +35,18 @@ private const val BUNDLE = "messages.PluginBundle"
*/
object PluginBundle : AbstractBundle(BUNDLE) {
+ val LOCALE: Locale by lazy {
+ val chineseLanguagePlugin = "com.intellij.zh"
+ if (PluginManager.isPluginInstalled(PluginId.getId(chineseLanguagePlugin))) {
+ Locale.CHINA
+ } else {
+ Locale.ROOT
+ }
+ }
+
//todo: shouldn't need to manually load bundle.
val LOCALE_BUNDLE: ResourceBundle by lazy {
- ResourceBundle.getBundle(BUNDLE, DynamicBundle.getLocale(), PluginBundle::class.java.classLoader)
+ ResourceBundle.getBundle(BUNDLE, LOCALE, PluginBundle::class.java.classLoader)
}
@Suppress("SpreadOperator")
diff --git a/plugin/src/main/kotlin/spp/jetbrains/sourcemarker/view/ActivityQuickStatsIndicator.kt b/plugin/src/main/kotlin/spp/jetbrains/sourcemarker/view/ActivityQuickStatsIndicator.kt
index 2b1006e02..3b5397be5 100644
--- a/plugin/src/main/kotlin/spp/jetbrains/sourcemarker/view/ActivityQuickStatsIndicator.kt
+++ b/plugin/src/main/kotlin/spp/jetbrains/sourcemarker/view/ActivityQuickStatsIndicator.kt
@@ -17,7 +17,6 @@
*/
package spp.jetbrains.sourcemarker.view
-import com.intellij.DynamicBundle
import com.intellij.openapi.application.ApplicationManager
import com.intellij.ui.JBColor
import io.vertx.core.json.Json
@@ -42,6 +41,7 @@ import spp.jetbrains.monitor.skywalking.bridge.EndpointMetricsBridge
import spp.jetbrains.monitor.skywalking.model.GetEndpointMetrics
import spp.jetbrains.monitor.skywalking.model.ZonedDuration
import spp.jetbrains.monitor.skywalking.toProtocol
+import spp.jetbrains.sourcemarker.PluginBundle
import spp.jetbrains.sourcemarker.PluginBundle.message
import spp.jetbrains.sourcemarker.PluginUI
import spp.jetbrains.sourcemarker.SourceMarkerPlugin.vertx
@@ -123,7 +123,7 @@ class ActivityQuickStatsIndicator(val config: SourceMarkerConfig) : SourceMarkEv
inlay.putUserData(SHOWING_QUICK_STATS, true)
inlay.configuration.virtualText = InlayMarkVirtualText(inlay, formatMetricResult(metricResult))
inlay.configuration.virtualText!!.textAttributes.foregroundColor = inlayForegroundColor
- if (DynamicBundle.getLocale().language == "zh") {
+ if (PluginBundle.LOCALE.language == "zh") {
inlay.configuration.virtualText!!.font = PluginUI.MICROSOFT_YAHEI_PLAIN_14
inlay.configuration.virtualText!!.xOffset = 15
}
diff --git a/plugin/src/main/resources/messages/PluginBundle.properties b/plugin/src/main/resources/messages/PluginBundle.properties
index a5299da3c..3729e339b 100644
--- a/plugin/src/main/resources/messages/PluginBundle.properties
+++ b/plugin/src/main/resources/messages/PluginBundle.properties
@@ -138,4 +138,7 @@ type=Type
count=Count
operation_name=Operation Name
sec_letter=s
-day=Day
\ No newline at end of file
+day=Day
+verify_host=Verify Host
+certificate_pins=Certificate Pins
+service=Service
\ No newline at end of file
diff --git a/plugin/src/main/resources/messages/PluginBundle_zh.properties b/plugin/src/main/resources/messages/PluginBundle_zh.properties
index cfe8325ac..5bde37ee6 100644
--- a/plugin/src/main/resources/messages/PluginBundle_zh.properties
+++ b/plugin/src/main/resources/messages/PluginBundle_zh.properties
@@ -137,4 +137,7 @@ type=类
count=数
operation_name=操作名称
sec_letter=秒
-day=日
\ No newline at end of file
+day=日
+verify_host=验证主机
+certificate_pins=证书别针
+service=营运
\ No newline at end of file