diff --git a/client/src/main/java/client/MyFXML.java b/client/src/main/java/client/MyFXML.java index 0d5e9c5..4026d7c 100644 --- a/client/src/main/java/client/MyFXML.java +++ b/client/src/main/java/client/MyFXML.java @@ -18,6 +18,8 @@ package client; import java.io.IOException; import java.net.URL; import java.nio.charset.StandardCharsets; +import java.util.Locale; +import java.util.ResourceBundle; import com.google.inject.Injector; @@ -28,6 +30,7 @@ import javafx.util.BuilderFactory; import javafx.util.Callback; import javafx.util.Pair; + public class MyFXML { private Injector injector; @@ -38,7 +41,8 @@ public class MyFXML { public Pair load(Class c, String... parts) { try { - var loader = new FXMLLoader(getLocation(parts), null, null, new MyFactory(), StandardCharsets.UTF_8); + ResourceBundle bundle = ResourceBundle.getBundle("locale.lang", Locale.getDefault()); + var loader = new FXMLLoader(getLocation(parts), bundle, null, new MyFactory(), StandardCharsets.UTF_8); Parent parent = loader.load(); T ctrl = loader.getController(); return new Pair<>(ctrl, parent); diff --git a/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java b/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java index cdbd565..8a4dde5 100644 --- a/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java +++ b/client/src/main/java/client/scenes/FoodpalApplicationCtrl.java @@ -256,6 +256,7 @@ public class FoodpalApplicationCtrl implements LocaleAware { removeRecipeButton.setText(getLocaleString("menu.button.remove.recipe")); cloneRecipeButton.setText(getLocaleString("menu.button.clone")); recipesLabel.setText(getLocaleString("menu.label.recipes")); + favouritesOnlyToggle.setText(getLocaleString("menu.button.favourite")); } @Override