From bf9481202a5cf1d22e1dddd86fd5c245cb76ac0d Mon Sep 17 00:00:00 2001 From: Emerson Pinter Date: Sat, 29 Jun 2024 19:28:33 -0300 Subject: [PATCH] Set Java default locale --- src/main/java/br/com/pinter/tqrespec/Main.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/br/com/pinter/tqrespec/Main.java b/src/main/java/br/com/pinter/tqrespec/Main.java index 6a6be73..11d6853 100644 --- a/src/main/java/br/com/pinter/tqrespec/Main.java +++ b/src/main/java/br/com/pinter/tqrespec/Main.java @@ -293,8 +293,10 @@ public void prepareMainStage(Stage primaryStage) { Locale gameLanguage = gameInfo.getGameLanguage(); if (gameLanguage != null) { State.get().setLocale(gameLanguage); - logger.log(System.Logger.Level.INFO, "Application language set to ''{0}''", State.get().getLocale()); } + Locale.setDefault(State.get().getLocale()); + logger.log(System.Logger.Level.INFO, "Application language set to ''{0}''", State.get().getLocale()); + fxmlLoader.setResources(ResourceBundle.getBundle("i18n.UI", State.get().getLocale())); fxmlLoader.setLocation(ResourceHelper.getResourceUrl(Constants.UI.MAIN_FXML)); root = fxmlLoader.load();