diff --git a/client/src/main/java/client/scenes/AddIngredientCtrl.java b/client/src/main/java/client/scenes/AddIngredientCtrl.java
index 11fcb25..70d6924 100644
--- a/client/src/main/java/client/scenes/AddIngredientCtrl.java
+++ b/client/src/main/java/client/scenes/AddIngredientCtrl.java
@@ -15,33 +15,61 @@
*/
package client.scenes;
+import client.utils.LocaleAware;
+import client.utils.LocaleManager;
import client.utils.ServerUtils;
import com.google.inject.Inject;
import commons.Recipe;
import jakarta.ws.rs.WebApplicationException;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyEvent;
import javafx.stage.Modality;
import java.io.IOException;
-public class AddIngredientCtrl {
+public class AddIngredientCtrl implements LocaleAware {
private final ServerUtils server;
private final MainCtrl mainCtrl;
private final FoodpalApplicationCtrl foodpalCtrl;
+ private final LocaleManager localeManager;
+
@FXML
public TextField ingredient;
+ @FXML
+ public Button okButton;
+
+ @FXML
+ public Button cancelButton;
+
+ @FXML
+ public Label ingredientLabel;
@Inject
- public AddIngredientCtrl(ServerUtils server, MainCtrl mainCtrl, FoodpalApplicationCtrl foodpalCtrl) {
+ public AddIngredientCtrl(ServerUtils server, MainCtrl mainCtrl,
+ FoodpalApplicationCtrl foodpalCtrl, LocaleManager localeManager) {
this.mainCtrl = mainCtrl;
this.server = server;
this.foodpalCtrl = foodpalCtrl;
+ this.localeManager = localeManager;
+ }
+
+ @Override
+ public void updateText() {
+ ingredientLabel.setText(getLocaleString("add.ingredient.label"));
+ okButton.setText(getLocaleString("button.ok"));
+ cancelButton.setText(getLocaleString("button.cancel"));
+ }
+
+ @Override
+ public LocaleManager getLocaleManager() {
+ return localeManager;
}
public void cancel() throws IOException, InterruptedException {
@@ -83,4 +111,5 @@ public class AddIngredientCtrl {
break;
}
}
+
}
\ No newline at end of file
diff --git a/client/src/main/java/client/scenes/AddNameCtrl.java b/client/src/main/java/client/scenes/AddNameCtrl.java
index 528ff90..73f86e6 100644
--- a/client/src/main/java/client/scenes/AddNameCtrl.java
+++ b/client/src/main/java/client/scenes/AddNameCtrl.java
@@ -21,6 +21,7 @@ import client.utils.ServerUtils;
import com.google.inject.Inject;
import jakarta.ws.rs.WebApplicationException;
+import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
@@ -37,9 +38,16 @@ public class AddNameCtrl implements LocaleAware {
private final LocaleManager localeManager;
+ @FXML
public TextField recipeName;
+
+ @FXML
public Label recipeNameLabel;
+
+ @FXML
public Button cancelButton;
+
+ @FXML
public Button okButton;
@Inject
@@ -52,8 +60,8 @@ public class AddNameCtrl implements LocaleAware {
@Override
public void updateText() {
recipeNameLabel.setText(getLocaleString("add.recipe.label"));
- okButton.setText(getLocaleString("add.recipe.button.ok"));
- cancelButton.setText(getLocaleString("add.recipe.button.cancel"));
+ okButton.setText(getLocaleString("button.ok"));
+ cancelButton.setText(getLocaleString("button.cancel"));
}
@Override
diff --git a/client/src/main/java/client/scenes/AddStepsCtrl.java b/client/src/main/java/client/scenes/AddStepsCtrl.java
index e042f66..abd9f51 100644
--- a/client/src/main/java/client/scenes/AddStepsCtrl.java
+++ b/client/src/main/java/client/scenes/AddStepsCtrl.java
@@ -15,33 +15,60 @@
*/
package client.scenes;
+import client.utils.LocaleAware;
+import client.utils.LocaleManager;
import client.utils.ServerUtils;
import com.google.inject.Inject;
import commons.Recipe;
import jakarta.ws.rs.WebApplicationException;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyEvent;
import javafx.stage.Modality;
import java.io.IOException;
-public class AddStepsCtrl {
+public class AddStepsCtrl implements LocaleAware {
private final ServerUtils server;
private final MainCtrl mainCtrl;
private final FoodpalApplicationCtrl foodpalCtrl;
+ private final LocaleManager localeManager;
@FXML
public TextField preparationStep;
+ @FXML
+ public Button okButton;
+
+ @FXML
+ public Button cancelButton;
+
+ @FXML
+ public Label preparationStepLabel;
@Inject
- public AddStepsCtrl(ServerUtils server, MainCtrl mainCtrl, FoodpalApplicationCtrl foodpalCtrl) {
+ public AddStepsCtrl(ServerUtils server, MainCtrl mainCtrl,
+ FoodpalApplicationCtrl foodpalCtrl, LocaleManager localeManager) {
this.mainCtrl = mainCtrl;
this.server = server;
this.foodpalCtrl = foodpalCtrl;
+ this.localeManager = localeManager;
+ }
+
+ @Override
+ public void updateText() {
+ preparationStepLabel.setText(getLocaleString("add.step.label"));
+ okButton.setText(getLocaleString("button.ok"));
+ cancelButton.setText(getLocaleString("button.cancel"));
+ }
+
+ @Override
+ public LocaleManager getLocaleManager() {
+ return localeManager;
}
public void cancel() throws IOException, InterruptedException {
@@ -83,4 +110,5 @@ public class AddStepsCtrl {
break;
}
}
+
}
\ No newline at end of file
diff --git a/client/src/main/java/client/utils/LocaleManager.java b/client/src/main/java/client/utils/LocaleManager.java
index 6fbaf5e..f3c388b 100644
--- a/client/src/main/java/client/utils/LocaleManager.java
+++ b/client/src/main/java/client/utils/LocaleManager.java
@@ -18,7 +18,10 @@ public class LocaleManager {
}
private void updateBundle() {
- ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_PATH, currentLocale.get());
+ ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_PATH,
+ currentLocale.get(),
+ ResourceBundle.Control.getControl(ResourceBundle.Control.FORMAT_PROPERTIES)
+ );
currentBundle.set(bundle);
}
diff --git a/client/src/main/resources/client/scenes/AddIngredient.fxml b/client/src/main/resources/client/scenes/AddIngredient.fxml
index ebb0970..5aaddde 100644
--- a/client/src/main/resources/client/scenes/AddIngredient.fxml
+++ b/client/src/main/resources/client/scenes/AddIngredient.fxml
@@ -7,9 +7,9 @@
-
-
+
+
-
+
-
+
\ No newline at end of file
diff --git a/client/src/main/resources/client/scenes/AddSteps.fxml b/client/src/main/resources/client/scenes/AddSteps.fxml
index b6aa2cd..adc4259 100644
--- a/client/src/main/resources/client/scenes/AddSteps.fxml
+++ b/client/src/main/resources/client/scenes/AddSteps.fxml
@@ -7,9 +7,9 @@
-
-
+
+
-
+
-
+
\ No newline at end of file
diff --git a/client/src/main/resources/client/scenes/QuoteOverview.fxml b/client/src/main/resources/client/scenes/QuoteOverview.fxml
deleted file mode 100644
index a64ca2f..0000000
--- a/client/src/main/resources/client/scenes/QuoteOverview.fxml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/client/src/main/resources/locale/lang.properties b/client/src/main/resources/locale/lang.properties
index 96a16e5..6a0ad65 100644
--- a/client/src/main/resources/locale/lang.properties
+++ b/client/src/main/resources/locale/lang.properties
@@ -1,4 +1,10 @@
+add.ingredient.title=Add Ingredient
add.recipe.title=Create recipe
+add.step.title=Add Step
+
+add.ingredient.label=Ingredient
add.recipe.label=Recipe Name
-add.recipe.button.ok=Ok
-add.recipe.button.cancel=Cancel
+add.step.label=Step
+
+button.ok=Ok
+button.cancel=Cancel
diff --git a/client/src/main/resources/locale/lang_en.properties b/client/src/main/resources/locale/lang_en.properties
index 96a16e5..89e3219 100644
--- a/client/src/main/resources/locale/lang_en.properties
+++ b/client/src/main/resources/locale/lang_en.properties
@@ -1,4 +1,10 @@
+add.ingredient.title=Add Ingredient
add.recipe.title=Create recipe
+add.step.title=Add Step
+
+add.ingredient.label=Ingredient
add.recipe.label=Recipe Name
-add.recipe.button.ok=Ok
-add.recipe.button.cancel=Cancel
+add.step.label=Preparation Step
+
+button.ok=Ok
+button.cancel=Cancel
diff --git a/client/src/main/resources/locale/lang_nl.properties b/client/src/main/resources/locale/lang_nl.properties
index 3f7db20..4e2fbcf 100644
--- a/client/src/main/resources/locale/lang_nl.properties
+++ b/client/src/main/resources/locale/lang_nl.properties
@@ -1,4 +1,10 @@
+add.ingredient.title=Ingredient toevoegen
add.recipe.title=Recept aanmaken
+add.step.title=Stap toevoegen
+
+add.ingredient.label=Ingredient
add.recipe.label=Receptnaam
-add.recipe.button.ok=Ok
-add.recipe.button.cancel=Annuleren
+add.step.label=Bereidingsstap
+
+button.ok=Ok
+button.cancel=Annuleren
\ No newline at end of file
diff --git a/client/src/main/resources/locale/lang_pl.properties b/client/src/main/resources/locale/lang_pl.properties
index ba51f7c..834662e 100644
--- a/client/src/main/resources/locale/lang_pl.properties
+++ b/client/src/main/resources/locale/lang_pl.properties
@@ -1,4 +1,10 @@
+add.ingredient.title=Dodaj sk?adnik
add.recipe.title=Utwórz przepis
+add.step.title=Dodaj instrukcje
+
+add.ingredient.label=Sk?adnik
add.recipe.label=Nazwa przepisu
-add.recipe.button.ok=Ok
-add.recipe.button.cancel=Anuluj
+add.step.label=Instrukcja
+
+button.ok=Ok
+button.cancel=Anuluj