Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## [Unreleased]

## [0.5.8]
### Fixed
- Fixed settings not opening with non default locales

## [0.5.7]
### Changed
- Added feature to enable and disable all problems with a keybind (thanks to khopland)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pluginGroup = org.OverEngineer
pluginName = InlineProblems
pluginRepositoryUrl = https://github.com/OverEngineer/InlineProblems
# SemVer format -> https://semver.org
pluginVersion = 0.5.7
pluginVersion = 0.5.8

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 212.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,28 @@
import com.intellij.DynamicBundle;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.PropertyKey;

import java.util.Locale;
import java.util.ResourceBundle;
import java.util.function.Supplier;

/**
* The SettingsBundle class is a dynamic bundle for managing internationalized messages.
/* The SettingsBundle class is a dynamic bundle for managing internationalized messages.
* It extends the DynamicBundle class.
*
* @author kuwei
*/
public final class SettingsBundle extends DynamicBundle {
@NonNls
public static final String BUNDLE = "messages.SettingsBundle";

private static final ResourceBundle DEFAULT_BUNDLE = ResourceBundle.getBundle(BUNDLE, Locale.ENGLISH);

private static final String BUNDLE = "messages.SettingsBundle";
private static final SettingsBundle INSTANCE = new SettingsBundle();

private SettingsBundle() {
super(BUNDLE);
try {
ResourceBundle.getBundle(BUNDLE, Locale.getDefault());
} catch (Exception e) {
Locale.setDefault(Locale.ENGLISH);
}
}

@NotNull
public static @Nls String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, Object @NotNull ... params) {
return INSTANCE.messageOrDefault(key, DEFAULT_BUNDLE.getString(key), params);
@Nls
public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) {
return INSTANCE.getMessage(key, params);
}

@NotNull
public static Supplier<@Nls String> messagePointer(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, Object @NotNull ... params) {
var result = INSTANCE.messageOrNull(key, params);
if (result == null) {
return () -> DEFAULT_BUNDLE.getString(key);
}
return () -> result;
public static Supplier<String> messagePointer(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) {
return INSTANCE.getLazyMessage(key, params);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public SettingsComponent() {
.addLabeledComponent(new JLabel(SettingsBundle.message("settings.problemFilterListLabel")), problemFilterList)
.addTooltip(SettingsBundle.message("settings.problemFilterListTooltip"))
.addLabeledComponent(new JLabel(SettingsBundle.message("settings.fileExtensionBlacklistLabel")), fileExtensionBlacklist)
.addTooltip(SettingsBundle.message("settings.fileExtensionBlaclistTooltip"))
.addTooltip(SettingsBundle.message("settings.fileExtensionBlacklistTooltip"))
.addSeparator()
.addComponent(new JBLabel(SettingsBundle.message("settings.submenu.colors")))
.addComponent(showErrors)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ settings.inlaySizeDeltaTooltip=Used to have smaller font size for the inlays, sh
settings.problemFilterListLabel=Problem filter list
settings.problemFilterListTooltip=Semicolon separated list of problem text beginnings that will not be handled
settings.fileExtensionBlacklistLabel=File extension blacklist
settings.fileExtensionBlaclistTooltip=Semicolon separated list of file extensions to ignore (like ".java;.md")
settings.fileExtensionBlacklistTooltip=Semicolon separated list of file extensions to ignore (like ".java;.md")
settings.submenu.colors=Colors
settings.errorTextColor=Error text color:
settings.errorLabelBorderColor=Error label border color:
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/messages/SettingsBundle_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ settings.inlaySizeDelta=\u5b57\u4f53\u5927\u5c0f\u5dee\u5f02
settings.inlaySizeDeltaTooltip=\u7528\u4e8e\u4e3a\u6807\u7b7e\u8bbe\u7f6e\u8f83\u5c0f\u7684\u5b57\u4f53\uff0c\u5fc5\u987b\u5c0f\u4e8e\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f
settings.problemFilterListLabel=\u95ee\u9898\u8fc7\u6ee4\u5217\u8868
settings.problemFilterListTooltip=\u4e0d\u5904\u7406\u7684\u95ee\u9898\u6587\u672c\u5f00\u5934\u7684\u7528\u5206\u53f7\u5206\u9694\u7684\u5217\u8868
settings.fileExtensionBlacklistLabel=File extension blacklist
settings.fileExtensionBlacklistTooltip=Semicolon separated list of file extensions to ignore (like ".java;.md")
settings.submenu.colors=\u989C\u8272
settings.errorTextColor=\u9519\u8BEF\u6587\u672C\u989C\u8272\uFF1A
settings.errorLabelBorderColor=\u9519\u8BEF\u6807\u7B7E\u8FB9\u6846\u989C\u8272\uFF1A
Expand Down
Loading