mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-02 11:54:36 +00:00
Issue #477 Log window uses Russian localization file evein if I select English language: fixed
This commit is contained in:
@@ -35,6 +35,7 @@ import java.util.Date;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.BoxLayout;
|
||||
@@ -62,7 +63,7 @@ public class ErrorLogFrame extends AppFrame {
|
||||
private Handler handler;
|
||||
private ImageIcon expandIcon;
|
||||
private ImageIcon collapseIcon;
|
||||
private ErrorState errorState;
|
||||
private ErrorState errorState = ErrorState.NO_ERROR;
|
||||
|
||||
public Handler getHandler() {
|
||||
return handler;
|
||||
@@ -71,10 +72,33 @@ public class ErrorLogFrame extends AppFrame {
|
||||
public static ErrorLogFrame getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new ErrorLogFrame();
|
||||
View.execInEventDispatch(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Logger logger = Logger.getLogger("");
|
||||
logger.addHandler(instance.getHandler());
|
||||
}
|
||||
});
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static ErrorLogFrame createNewInstance() {
|
||||
if (instance != null) {
|
||||
View.execInEventDispatch(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Logger logger = Logger.getLogger("");
|
||||
logger.removeHandler(instance.getHandler());
|
||||
}
|
||||
});
|
||||
instance.setVisible(false);
|
||||
instance.dispose();
|
||||
instance = null;
|
||||
}
|
||||
return getInstance();
|
||||
}
|
||||
|
||||
public ErrorState getErrorState() {
|
||||
return errorState;
|
||||
}
|
||||
|
||||
@@ -634,13 +634,6 @@ public class Main {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
View.execInEventDispatch(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Logger logger = Logger.getLogger("");
|
||||
logger.addHandler(ErrorLogFrame.getInstance().getHandler());
|
||||
}
|
||||
});
|
||||
autoCheckForUpdates();
|
||||
offerAssociation();
|
||||
}
|
||||
@@ -671,6 +664,7 @@ public class Main {
|
||||
public static void initLang() {
|
||||
Locale.setDefault(Locale.forLanguageTag(Configuration.locale.get()));
|
||||
AppStrings.updateLanguage();
|
||||
ErrorLogFrame.createNewInstance();
|
||||
|
||||
UIManager.put("OptionPane.okButtonText", AppStrings.translate("button.ok"));
|
||||
UIManager.put("OptionPane.yesButtonText", AppStrings.translate("button.yes"));
|
||||
@@ -790,7 +784,6 @@ public class Main {
|
||||
public static void main(String[] args) throws IOException {
|
||||
startFreeMemThread();
|
||||
initLogging(Configuration.debugMode.get());
|
||||
|
||||
initLang();
|
||||
|
||||
if (Configuration.cacheOnDisk.get()) {
|
||||
|
||||
@@ -128,7 +128,6 @@ public class SelectLanguageDialog extends AppDialog implements ActionListener {
|
||||
|
||||
public static void reloadUi() {
|
||||
Locale.setDefault(Locale.forLanguageTag(Configuration.locale.get()));
|
||||
AppStrings.updateLanguage();
|
||||
DefaultSyntaxKit.reloadConfigs();
|
||||
Main.initLang();
|
||||
Main.reloadApp();
|
||||
|
||||
Reference in New Issue
Block a user