Changed the fxml files to using internationalized strings

This commit is contained in:
Mei Chang van der Werff 2026-01-11 18:36:47 +01:00
commit 076e13486c
5 changed files with 28 additions and 41 deletions

View file

@ -2,22 +2,16 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ButtonBar?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.ToolBar?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.control.ComboBox?>
<BorderPane prefHeight="800.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/25" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.FoodpalApplicationCtrl">
<BorderPane prefHeight="800.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.FoodpalApplicationCtrl">
<!-- TOP BAR -->
<top>
@ -41,27 +35,27 @@
</padding>
<fx:include source="LangSelect.fxml" />
<Button fx:id="refreshButton" onAction="#refresh" prefHeight="25.0" prefWidth="34.0" text="⟳" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label fx:id="recipesLabel" text="Recipes">
<Label fx:id="recipesLabel" text="%menu.label.recipes">
<font>
<Font name="System Bold" size="15.0" />
</font></Label>
<fx:include source="SearchBar.fxml" fx:id="searchBar" />
<fx:include fx:id="searchBar" source="SearchBar.fxml" />
<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" />
<ToggleButton fx:id="favouritesOnlyToggle" text="Favourites" onAction="#toggleFavouritesView"/>
<Button fx:id="addRecipeButton" onAction="#addRecipe" text="%menu.button.add.recipe" />
<Button fx:id="removeRecipeButton" onAction="#removeSelectedRecipe" text="%menu.button.remove.recipe" />
<Button fx:id="cloneRecipeButton" mnemonicParsing="false" onAction="#cloneRecipe" text="%menu.button.clone" />
<ToggleButton fx:id="favouritesOnlyToggle" onAction="#toggleFavouritesView" text="%menu.button.favourite" />
</HBox>
</VBox>
</left>
<!-- CENTER: RECIPE DETAILS -->
<center>
<fx:include source="recipe/RecipeDetailView.fxml" fx:id="recipeDetail" />
<fx:include fx:id="recipeDetail" source="recipe/RecipeDetailView.fxml" />
</center>
</BorderPane>

View file

@ -3,9 +3,8 @@
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.HBox?>
<HBox xmlns="http://javafx.com/javafx/25" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.SearchBarCtrl">
<HBox xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.SearchBarCtrl">
<children>
<TextField fx:id="searchField" promptText="Search..." />
<TextField fx:id="searchField" promptText="%menu.search" />
</children>
</HBox>

View file

@ -9,13 +9,13 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane xmlns="http://javafx.com/javafx/25" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.recipe.IngredientListCtrl">
<AnchorPane xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.recipe.IngredientListCtrl">
<children>
<VBox minHeight="200.0" minWidth="200.0">
<children>
<HBox alignment="CENTER_LEFT" spacing="20.0">
<children>
<Label fx:id="ingredientsLabel" text="Ingredients">
<Label fx:id="ingredientsLabel" text="%menu.label.ingredients">
<padding>
<Insets bottom="5.0" top="5.0" />
</padding>
@ -25,8 +25,8 @@
</Label>
<HBox alignment="CENTER" spacing="10.0">
<children>
<Button fx:id="addIngredientButton" mnemonicParsing="false" text="Add" />
<Button fx:id="deleteIngredientButton" mnemonicParsing="false" text="Delete" />
<Button fx:id="addIngredientButton" mnemonicParsing="false" text="menu.button.add.ingredient" />
<Button fx:id="deleteIngredientButton" mnemonicParsing="false" text="%menu.button.remove.ingredient" />
</children>
</HBox>
</children>

View file

@ -1,17 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<VBox
xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="client.scenes.recipe.RecipeDetailCtrl"
spacing="20" visible="false" fx:id="detailsScreen">
<VBox fx:id="detailsScreen" spacing="20" visible="false" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.recipe.RecipeDetailCtrl">
<padding>
<Insets bottom="10" left="10" right="10" top="10" />
@ -21,15 +15,15 @@
<HBox spacing="10">
<HBox fx:id="editableTitleArea">
</HBox>
<Button fx:id="editRecipeTitleButton" onAction="#editRecipeTitle" text="Edit" />
<Button fx:id="removeRecipeButton" mnemonicParsing="false" onAction="#removeSelectedRecipe" text="Remove Recipe" />
<Button fx:id="printRecipeButton" mnemonicParsing="false" onAction="#printRecipe" text="Print Recipe" />
<Button fx:id="editRecipeTitleButton" onAction="#editRecipeTitle" text="%menu.button.edit" />
<Button fx:id="removeRecipeButton" mnemonicParsing="false" onAction="#removeSelectedRecipe" text="%menu.button.remove.recipe" />
<Button fx:id="printRecipeButton" mnemonicParsing="false" onAction="#printRecipe" text="%menu.button.print" />
<Button fx:id="favouriteButton" onAction="#toggleFavourite" text="☆" />
</HBox>
<!-- Ingredients -->
<fx:include source="IngredientList.fxml" fx:id="ingredientList" />
<fx:include fx:id="ingredientList" source="IngredientList.fxml" />
<!-- Preparation -->
<fx:include source="RecipeStepList.fxml" fx:id="stepList" />
<fx:include fx:id="stepList" source="RecipeStepList.fxml" />
</VBox>

View file

@ -9,13 +9,13 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane xmlns="http://javafx.com/javafx/25" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.recipe.RecipeStepListCtrl">
<AnchorPane xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.recipe.RecipeStepListCtrl">
<children>
<VBox minHeight="200.0" minWidth="200.0">
<children>
<HBox alignment="CENTER_LEFT" spacing="20.0">
<children>
<Label fx:id="stepsLabel" text="Steps">
<Label fx:id="stepsLabel" text="%menu.label.preparation">
<padding>
<Insets bottom="5.0" top="5.0" />
</padding>
@ -25,8 +25,8 @@
</Label>
<HBox alignment="CENTER" spacing="10.0">
<children>
<Button fx:id="addStepButton" mnemonicParsing="false" text="Add" />
<Button fx:id="deleteStepButton" mnemonicParsing="false" text="Delete" />
<Button fx:id="addStepButton" mnemonicParsing="false" text="%menu.button.add.step" />
<Button fx:id="deleteStepButton" mnemonicParsing="false" text="%menu.button.remove.step" />
</children>
</HBox>
</children>