refactor: integrate remote main changes (locale)

This commit is contained in:
Zhongheng Liu 2025-12-04 16:56:07 +01:00
commit 7d2cadc800
Signed by: steven
GPG key ID: F69B980899C1C09D
19 changed files with 491 additions and 165 deletions

View file

@ -7,9 +7,9 @@
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="94.0" prefWidth="470.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.AddIngredientCtrl">
<children>
<Button layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<Button fx:id="okButton" layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button fx:id="cancelButton" layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<TextField fx:id="ingredient" layoutX="120.0" layoutY="24.0" prefHeight="18.0" prefWidth="292.0" />
<Label layoutX="28.0" layoutY="29.0" text="Ingredient Name" />
<Label fx:id="ingredientLabel" layoutX="28.0" layoutY="29.0" text="Ingredient Name" />
</children>
</AnchorPane>
</AnchorPane>

View file

@ -7,9 +7,9 @@
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="94.0" prefWidth="470.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.AddNameCtrl">
<children>
<Button layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<Button fx:id="okButton" layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button fx:id="cancelButton" layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<TextField fx:id="recipeName" layoutX="109.0" layoutY="24.0" prefHeight="18.0" prefWidth="292.0" />
<Label layoutX="28.0" layoutY="29.0" text="Recipe Name" />
<Label fx:id="recipeNameLabel" layoutX="28.0" layoutY="29.0" text="Recipe Name" />
</children>
</AnchorPane>
</AnchorPane>

View file

@ -7,9 +7,9 @@
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="94.0" prefWidth="470.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.AddStepsCtrl">
<children>
<Button layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<Button fx:id="okButton" layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button fx:id="cancelButton" layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<TextField fx:id="preparationStep" layoutX="120.0" layoutY="24.0" prefHeight="18.0" prefWidth="292.0" />
<Label layoutX="28.0" layoutY="29.0" text="Preparation step" />
<Label fx:id="preparationStepLabel" layoutX="28.0" layoutY="29.0" text="Preparation step" />
</children>
</AnchorPane>
</AnchorPane>

View file

@ -23,57 +23,57 @@
<padding>
<Insets bottom="10" left="10" right="10" top="10" />
</padding>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="198.0" minWidth="10.0" prefWidth="130.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="95.0" minWidth="2.0" prefWidth="70.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="54.0" minHeight="10.0" prefHeight="54.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="25.0" minHeight="6.0" prefHeight="6.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label prefHeight="56.0" prefWidth="158.0" text="FoodPal">
<font>
<Font name="System Bold" size="29.0" />
</font>
</Label>
<ButtonBar prefHeight="40.0" prefWidth="200.0" GridPane.rowIndex="2">
<buttons>
<ToolBar prefHeight="35.0" prefWidth="123.0">
<items>
<Button fx:id="flagEnButton" minWidth="33.0" onAction="#switchToEnglish" prefHeight="25.0" prefWidth="33.0" text="EN" />
<Button fx:id="flagNlButton" onAction="#switchToDutch" text="NL" />
<Button fx:id="flagPlButton" onAction="#switchToPolish" text="PL" />
</items>
</ToolBar>
</buttons>
</ButtonBar>
</children>
</GridPane>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="198.0" minWidth="10.0" prefWidth="130.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="95.0" minWidth="2.0" prefWidth="70.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="54.0" minHeight="10.0" prefHeight="54.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="25.0" minHeight="6.0" prefHeight="6.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Pane HBox.hgrow="ALWAYS" />
<Label prefHeight="56.0" prefWidth="158.0" text="FoodPal">
<font>
<Font name="System Bold" size="29.0" />
</font>
</Label>
<ButtonBar prefHeight="40.0" prefWidth="200.0" GridPane.rowIndex="2">
<buttons>
<ToolBar prefHeight="35.0" prefWidth="123.0">
<items>
<Button fx:id="flagEnButton" minWidth="33.0" onAction="#switchLocale" userData="en" prefHeight="25.0" prefWidth="33.0" text="EN" />
<Button fx:id="flagNlButton" onAction="#switchLocale" userData="nl" text="NL" />
<Button fx:id="flagPlButton" onAction="#switchLocale" userData="pl" text="PL" />
</items>
</ToolBar>
</buttons>
</ButtonBar>
</children>
</GridPane>
<HBox spacing="5" />
<GridPane prefHeight="90.0" prefWidth="114.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="315.0" minWidth="10.0" prefWidth="32.1666259765625" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="315.0" minWidth="10.0" prefWidth="24.8333740234375" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="173.0" minWidth="10.0" prefWidth="28.6666259765625" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="95.0" minWidth="10.0" prefWidth="34.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Pane HBox.hgrow="ALWAYS" />
<Button fx:id="refreshButton" onAction="#refresh" prefHeight="25.0" prefWidth="34.0" text="⟳" GridPane.columnIndex="3" GridPane.rowIndex="2" />
</children>
</GridPane>
<HBox spacing="5" />
<GridPane prefHeight="90.0" prefWidth="114.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="315.0" minWidth="10.0" prefWidth="32.1666259765625" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="315.0" minWidth="10.0" prefWidth="24.8333740234375" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="173.0" minWidth="10.0" prefWidth="28.6666259765625" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="95.0" minWidth="10.0" prefWidth="34.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="refreshButton" onAction="#refresh" prefHeight="25.0" prefWidth="34.0" text="⟳" GridPane.columnIndex="3" GridPane.rowIndex="2" />
</children>
</GridPane>
</HBox>
</top>
@ -84,17 +84,17 @@
<Insets bottom="10" left="10" right="10" top="10" />
</padding>
<Label text="Recipes">
<font>
<Font name="System Bold" size="15.0" />
</font></Label>
<Label fx:id="recipesLabel" text="Recipes">
<font>
<Font name="System Bold" size="15.0" />
</font></Label>
<ListView fx:id="recipeList" />
<HBox spacing="10">
<Button fx:id="AddRecipeButton" onAction="#addRecipe" text="Add Recipe" />
<Button fx:id="RemoveRecipeButton" onAction="#removeSelectedRecipe" text="Remove Recipe" />
<Button fx:id= "CloneREcipeButton" mnemonicParsing="false" onAction="#cloneRecipe" text="Clone" />
<Button fx:id="addRecipeButton" onAction="#addRecipe" text="Add Recipe" />
<Button fx:id="removeRecipeButton" onAction="#removeSelectedRecipe" text="Remove Recipe" />
<Button fx:id= "cloneRecipeButton" mnemonicParsing="false" onAction="#cloneRecipe" text="Clone" />
</HBox>
</VBox>
</left>
@ -110,15 +110,14 @@
<HBox spacing="10">
<HBox fx:id="editableTitleArea">
</HBox>
<Button fx:id="editRecipeTitleButton" onAction="#editRecipeTitle" text="Edit" />
<Button fx:id="RemoveRecipeButton2" mnemonicParsing="false" onAction="#removeSelectedRecipe" text="Remove Recipe" />
<Button fx:id="printRecipe" mnemonicParsing="false" onAction="#makePrintable" text="Print Recipe" />
<Button fx:id="removeRecipeButton2" mnemonicParsing="false" onAction="#removeSelectedRecipe" text="Remove Recipe" />
<Button fx:id="printRecipeButton" mnemonicParsing="false" onAction="#makePrintable" text="Print Recipe" />
</HBox>
<!-- Ingredients -->
<VBox spacing="10">
<Label text="Ingredients">
<Label fx:id="ingredientsLabel" text="Ingredients">
<font>
<Font name="System Bold" size="14.0" />
</font>
@ -128,7 +127,7 @@
</VBox>
<!-- Preparation -->
<Label text="Preparation">
<Label fx:id="preparationLabel" text="Preparation">
<font>
<Font name="System Bold" size="14.0" />
</font>
@ -136,16 +135,16 @@
<ListView fx:id="preparationListView" prefHeight="200.0" />
<Button fx:id="addPreparationStepButton" onAction="#addPreparationStep" text="Add Step" />
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="890.6666870117188" minWidth="10.0" prefWidth="854.6666870117188" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="445.3333740234375" minWidth="10.0" prefWidth="57.33331298828125" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="890.6666870117188" minWidth="10.0" prefWidth="854.6666870117188" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="445.3333740234375" minWidth="10.0" prefWidth="57.33331298828125" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</VBox>
</center>

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.QuoteOverviewCtrl">
<children>
<Button layoutX="503.0" layoutY="360.0" mnemonicParsing="false" onAction="#addQuote" text="Add Quote" />
<Button layoutX="431.0" layoutY="360.0" mnemonicParsing="false" onAction="#refresh" text="Refresh" />
<TableView fx:id="table" layoutX="14.0" layoutY="14.0" prefHeight="337.0" prefWidth="572.0">
<columns>
<TableColumn fx:id="colFirstName" prefWidth="113.0" text="First Name" />
<TableColumn fx:id="colLastName" prefWidth="114.0" text="Last Name" />
<TableColumn fx:id="colQuote" prefWidth="344.0" text="Quote" />
</columns>
</TableView>
</children>
</AnchorPane>

View file

@ -0,0 +1,26 @@
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.step.label=Step
button.ok=Ok
button.cancel=Cancel
menu.label.recipes=Recipes
menu.label.ingredients=Ingredients
menu.label.preparation=Preparation
menu.button.add.recipe=Add Recipe
menu.button.add.ingredient=Add Ingredient
menu.button.add.step=Add Step
menu.button.remove.recipe=Remove Recipe
menu.button.remove.ingredient=Remove Ingredient
menu.button.remove.step=Remove Step
menu.button.edit=Edit
menu.button.clone=Clone
menu.button.print=Print recipe

View file

@ -0,0 +1,26 @@
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.step.label=Step
button.ok=Ok
button.cancel=Cancel
menu.label.recipes=Recipes
menu.label.ingredients=Ingredients
menu.label.preparation=Preparation
menu.button.add.recipe=Add Recipe
menu.button.add.ingredient=Add Ingredient
menu.button.add.step=Add Step
menu.button.remove.recipe=Remove Recipe
menu.button.remove.ingredient=Remove Ingredient
menu.button.remove.step=Remove Step
menu.button.edit=Edit
menu.button.clone=Clone
menu.button.print=Print recipe

View file

@ -0,0 +1,26 @@
add.ingredient.title=Ingredient toevoegen
add.recipe.title=Recept aanmaken
add.step.title=Stap toevoegen
add.ingredient.label=Ingredient
add.recipe.label=Receptnaam
add.step.label=Bereidingsstap
button.ok=Ok
button.cancel=Annuleren
menu.label.recipes=Recepten
menu.label.ingredients=Ingrediënten
menu.label.preparation=Bereiding
menu.button.add.recipe=Recept toevoegen
menu.button.add.ingredient=Ingrediënt toevoegen
menu.button.add.step=Stap toevoegen
menu.button.remove.recipe=Recept verwijderen
menu.button.remove.ingredient=Ingrediënt verwijderen
menu.button.remove.step=Stap verwijderen
menu.button.edit=Bewerken
menu.button.clone=Dupliceren
menu.button.print=Recept afdrukken

View file

@ -0,0 +1,26 @@
add.ingredient.title=Dodaj składnik
add.recipe.title=Utwórz przepis
add.step.title=Dodaj instrukcję
add.ingredient.label=Składnik
add.recipe.label=Nazwa przepisu
add.step.label=Instrukcja
button.ok=Ok
button.cancel=Anuluj
menu.label.recipes=Przepisy
menu.label.ingredients=Składniki
menu.label.preparation=Przygotowanie
menu.button.add.recipe=Dodaj przepis
menu.button.add.ingredient=Dodaj składnik
menu.button.add.step=Dodaj instrukcję
menu.button.remove.recipe=Usuń przepis
menu.button.remove.ingredient=Usuń składnik
menu.button.remove.step=Usuń instrukcję
menu.button.edit=Edytuj
menu.button.clone=Duplikuj
menu.button.print=Drukuj przepis