From 0066f426c395ed4ecea964947cffb498f2c81a77 Mon Sep 17 00:00:00 2001 From: kmitresse Date: Wed, 12 Jun 2024 11:01:53 +0200 Subject: [PATCH] feat: devweb - Make translations on new game configuration page --- .../main/webapp/WEB-INF/pages/new-game.jsp | 8 ++-- .../webapp/WEB-INF/tags/forms/new-game.tag | 24 +++++----- .../src/main/webapp/WEB-INF/translations.json | 44 +++++++++++++++++++ 3 files changed, 62 insertions(+), 14 deletions(-) diff --git a/S2/DevWeb/Projet/src/main/webapp/WEB-INF/pages/new-game.jsp b/S2/DevWeb/Projet/src/main/webapp/WEB-INF/pages/new-game.jsp index 77f51e1..726ee18 100644 --- a/S2/DevWeb/Projet/src/main/webapp/WEB-INF/pages/new-game.jsp +++ b/S2/DevWeb/Projet/src/main/webapp/WEB-INF/pages/new-game.jsp @@ -1,9 +1,11 @@ +<%@ page import="uppa.project.web.translation.Translator" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@taglib prefix="component" tagdir="/WEB-INF/tags/components" %> <%@taglib prefix="layout" tagdir="/WEB-INF/tags/layouts" %> <%@taglib prefix="form" tagdir="/WEB-INF/tags/forms" %> +<% Translator translator = (Translator) request.getSession().getAttribute("translator"); %> - + @@ -12,11 +14,11 @@
-

Nouvelle partie

+

${translator.translate('new_game_configuration_title')}

diff --git a/S2/DevWeb/Projet/src/main/webapp/WEB-INF/tags/forms/new-game.tag b/S2/DevWeb/Projet/src/main/webapp/WEB-INF/tags/forms/new-game.tag index d7fcb61..f60decd 100644 --- a/S2/DevWeb/Projet/src/main/webapp/WEB-INF/tags/forms/new-game.tag +++ b/S2/DevWeb/Projet/src/main/webapp/WEB-INF/tags/forms/new-game.tag @@ -1,41 +1,43 @@ <%@ tag import="uppa.project.database.pojo.Deck" %> <%@ tag import="uppa.project.database.pojo.Game" %> +<%@ tag import="uppa.project.web.translation.Translator" %> <%@tag description="form/new-game" pageEncoding="UTF-8" %> +<% Translator translator = (Translator) request.getSession().getAttribute("translator"); %> <%@attribute name="back_button" fragment="true" %>
-

Paramètres Généraux

+

${translator.translate('new_game_configuration_global_parameters')}

- +
-

Paramètres des Manches

+

${translator.translate('new_game_configuration_rounds_parameters')}

- +
- +
-

Paramètres du Deck

+

${translator.translate('new_game_configuration_Deck_parameters')}

${Deck.NB_COLORS_MIN} @@ -60,7 +62,7 @@
${Deck.NB_VALUES_PER_COLOR_MIN} @@ -76,7 +78,7 @@
- +
diff --git a/S2/DevWeb/Projet/src/main/webapp/WEB-INF/translations.json b/S2/DevWeb/Projet/src/main/webapp/WEB-INF/translations.json index a4f9025..b896b2d 100644 --- a/S2/DevWeb/Projet/src/main/webapp/WEB-INF/translations.json +++ b/S2/DevWeb/Projet/src/main/webapp/WEB-INF/translations.json @@ -434,5 +434,49 @@ "rules_end" : { "EN": "Good luck and have fun!", "FR": "Alors affûtez votre agilité et visez la victoire!" + }, + "new_game_configuration_title" : { + "EN": "New game", + "FR": "Nouvelle partie" + }, + "new_game_configuration_global_parameters" : { + "EN": "Global parameters", + "FR": "Paramètres Généraux" + }, + "new_game_configuration_global_parameters_difficulty" : { + "EN": "Difficulty", + "FR": "Difficulté" + }, + "new_game_configuration_rounds_parameters" : { + "EN": "Rounds parameters", + "FR": "Paramètres des manches" + }, + "new_game_configuration_rounds_parameters_number" : { + "EN": "Number of rounds", + "FR": "Nombre de manches" + }, + "new_game_configuration_rounds_parameters_duration" : { + "EN": "Duration of a round (seconds)", + "FR": "Durée d'une manche (secondes)" + }, + "new_game_configuration_Deck_parameters" : { + "EN": "Deck parameters", + "FR": "Paramètres du Deck" + }, + "new_game_configuration_Deck_parameters_color_number" : { + "EN": "Number of colors:", + "FR": "Nombre de couleurs :" + }, + "new_game_configuration_Deck_parameters_value_number" : { + "EN": "Number of values:", + "FR": "Nombre de valeurs :" + }, + "new_game_back" : { + "EN": "Back to main menu", + "FR": "Retour au menu" + }, + "new_game_create" : { + "EN": "Create game", + "FR": "Créer la partie" } }