mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-04 21:14:18 +00:00
Locale set as default
This commit is contained in:
@@ -27,7 +27,7 @@ import javax.swing.JDialog;
|
||||
*/
|
||||
public abstract class AppDialog extends JDialog {
|
||||
|
||||
private ResourceBundle resourceBundle = ResourceBundle.getBundle(AppStrings.getResourcePath(getClass()), Configuration.containsConfig("locale") ? Locale.forLanguageTag((String) Configuration.getConfig("locale", "en")) : Locale.getDefault());
|
||||
private ResourceBundle resourceBundle = ResourceBundle.getBundle(AppStrings.getResourcePath(getClass()));
|
||||
|
||||
public AppDialog() {
|
||||
View.installEscapeCloseOperation(this);
|
||||
|
||||
@@ -27,7 +27,7 @@ import javax.swing.JFrame;
|
||||
*/
|
||||
public abstract class AppFrame extends JFrame {
|
||||
|
||||
private ResourceBundle resourceBundle = ResourceBundle.getBundle(AppStrings.getResourcePath(getClass()), Configuration.containsConfig("locale") ? Locale.forLanguageTag((String) Configuration.getConfig("locale", "en")) : Locale.getDefault());
|
||||
private ResourceBundle resourceBundle = ResourceBundle.getBundle(AppStrings.getResourcePath(getClass()));
|
||||
|
||||
public String translate(String key) {
|
||||
return resourceBundle.getString(key);
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.ResourceBundle;
|
||||
*/
|
||||
public class AppStrings {
|
||||
|
||||
private static ResourceBundle resourceBundle = ResourceBundle.getBundle(getResourcePath(MainFrame.class), Configuration.containsConfig("locale") ? Locale.forLanguageTag((String) Configuration.getConfig("locale", "en")) : Locale.getDefault());
|
||||
private static ResourceBundle resourceBundle = ResourceBundle.getBundle(getResourcePath(MainFrame.class));
|
||||
|
||||
public static String getResourcePath(Class cls) {
|
||||
String name = cls.getName();
|
||||
@@ -42,7 +42,7 @@ public class AppStrings {
|
||||
}
|
||||
|
||||
public static String translate(String bundle, String key) {
|
||||
ResourceBundle b = ResourceBundle.getBundle(bundle, Configuration.containsConfig("locale") ? Locale.forLanguageTag((String) Configuration.getConfig("locale", "en")) : Locale.getDefault());
|
||||
ResourceBundle b = ResourceBundle.getBundle(bundle);
|
||||
return b.getString(key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,10 +465,10 @@ public class Main {
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void main(String[] args) throws IOException {
|
||||
Locale.setDefault(Locale.GERMAN);
|
||||
loadProperties();
|
||||
View.setLookAndFeel();
|
||||
Configuration.loadFromFile(getConfigFile(), getReplacementsFile());
|
||||
Locale.setDefault(Locale.forLanguageTag((String) Configuration.getConfig("locale", Locale.getDefault())));
|
||||
|
||||
if ((Boolean) Configuration.getConfig("cacheOnDisk", Boolean.TRUE)) {
|
||||
Cache.setStorageType(Cache.STORAGE_FILES);
|
||||
|
||||
Reference in New Issue
Block a user