I'm using resource bundles to manage languages in my app. In my main class i have:
@Override
public void start(Stage primaryStage) throws Exception{
Locale.setDefault(new Locale("pl"));
ResourceBundle bundle = ResourceBundle.getBundle("bundles.messages");
Parent root = FXMLLoader.load(Gui.class.getResource("difficulty_choice_window.fxml"), bundle);
Scene scene = new Scene(root);
primaryStage.setTitle("SudokuGame");
primaryStage.setScene(scene);
primaryStage.show();
}
And setting language from this level, works perfectly fine, so i wanted to add a feature to change the language in the application's run time, hence i assigned this line, to a button that's suppoused to change the language:
Locale.setDefault(new Locale("en"));
As you might guess - it doesn't work. What would be the correct way to do it?