From d65ec81b59aa071d55de855be16c834f87ce4791 Mon Sep 17 00:00:00 2001 From: Pierre Ferreira Date: Wed, 13 Dec 2023 15:29:29 +0100 Subject: [PATCH 1/8] ajout de la traduction pour toute la page NewPlay pour fr et en :zap: --- cryptide_project/src/Components/NavBar.tsx | 8 +- .../src/Components/ScoreBoard.tsx | 108 +++++++++--------- cryptide_project/src/Pages/Lobbies.tsx | 15 ++- cryptide_project/src/Pages/NewPlay.tsx | 18 +-- cryptide_project/src/Translations/en.json | 42 +++++-- cryptide_project/src/Translations/es.json | 5 + cryptide_project/src/Translations/fr.json | 43 +++++-- cryptide_project/src/Translations/pt.json | 6 + cryptide_project/src/Translations/ru.json | 5 + 9 files changed, 164 insertions(+), 86 deletions(-) diff --git a/cryptide_project/src/Components/NavBar.tsx b/cryptide_project/src/Components/NavBar.tsx index 1aff0fe..1f05662 100644 --- a/cryptide_project/src/Components/NavBar.tsx +++ b/cryptide_project/src/Components/NavBar.tsx @@ -1,7 +1,7 @@ import React, {useEffect, useState} from 'react'; /* Naviagtion */ -import { Navbar, Container, Nav, NavDropdown } from 'react-bootstrap'; +import { Navbar, Container, Nav, NavDropdown } from 'react-bootstrap'; /* Lang */ import { FormattedMessage } from 'react-intl'; @@ -58,13 +58,13 @@ function AppNavbar({changeLocale, locale}) {
diff --git a/cryptide_project/src/Components/ScoreBoard.tsx b/cryptide_project/src/Components/ScoreBoard.tsx index 2ceb2a0..a6115f6 100644 --- a/cryptide_project/src/Components/ScoreBoard.tsx +++ b/cryptide_project/src/Components/ScoreBoard.tsx @@ -27,6 +27,8 @@ import { BiLineChart, BiLineChartDown } from 'react-icons/bi'; import { CarouselCaption } from 'react-bootstrap'; import { BsLine } from 'react-icons/bs'; +import { FormattedMessage, useIntl } from 'react-intl'; + //@ts-ignore const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { const theme=useTheme(); @@ -90,6 +92,8 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { fetchWeeklyStats(); }, []); + const intl = useIntl(); + return ( = ({ Player }) => { }} id="ScoreBoard" className="tabsStats justify-content-around"> - +
-
Mastermind
+

-

Parties Jouées: {Player.mastermindStats.nbGames}

-

Best-Score: {Player.mastermindStats.bestScore}

-

Moyenne d'essai: {Player.mastermindStats.avgNbTry.toFixed(2)}

+

: {Player.mastermindStats.nbGames}

+

: {Player.mastermindStats.bestScore}

+

: {Player.mastermindStats.avgNbTry.toFixed(2)}

Enigme facile

-

Parties Jouées: {Player.easyEnigmaStats.nbGames}

-

Nombre de victoires: {Player.easyEnigmaStats.nbWins}

-

Ratio V/D: {Player.easyEnigmaStats.ratio.toFixed(2) + "%"}

-

Meilleur temps: {Player.easyEnigmaStats.bestTime + "s"}

-

Moyenne de temps: {Player.easyEnigmaStats.avgTime.toFixed(2) + "s"}

+

: {Player.easyEnigmaStats.nbGames}

+

: {Player.easyEnigmaStats.nbWins}

+

: {Player.easyEnigmaStats.ratio.toFixed(2) + "%"}

+

: {Player.easyEnigmaStats.bestTime + "s"}

+

: {Player.easyEnigmaStats.avgTime.toFixed(2) + "s"}

Enigme moyenne

-

Parties Jouées: {Player.mediumEnigmaStats.nbGames}

-

Best-Score: {Player.mediumEnigmaStats.bestScore}

-

Moyenne d'essai: {Player.mediumEnigmaStats.avgNbTry.toFixed(2)}

+

: {Player.mediumEnigmaStats.nbGames}

+

: {Player.mediumEnigmaStats.bestScore}

+

: {Player.mediumEnigmaStats.avgNbTry.toFixed(2)}

Enigme difficile

-

Parties Jouées: {Player.hardEnigmaStats.nbGames}

-

Nombre de victoires: {Player.hardEnigmaStats.nbWins}

-

Ratio V/D: {Player.hardEnigmaStats.ratio.toFixed(2) + "%"}

-

Meilleur temps: {Player.hardEnigmaStats.bestTime + "s"}

-

Moyenne de temps: {Player.hardEnigmaStats.avgTime.toFixed(2) + "s"}

+

: {Player.hardEnigmaStats.nbGames}

+

: {Player.hardEnigmaStats.nbWins}

+

: {Player.hardEnigmaStats.ratio.toFixed(2) + "%"}

+

: {Player.hardEnigmaStats.bestTime + "s"}

+

: {Player.hardEnigmaStats.avgTime.toFixed(2) + "s"}

En ligne

-

Parties Jouées: {Player.onlineStats.nbGames}

-

Nombre de victoires: {Player.onlineStats.nbWins}

-

Ratio V/D: {Player.onlineStats.ratio.toFixed(2) + "s"}

+

: {Player.onlineStats.nbGames}

+

: {Player.onlineStats.nbWins}

+

: {Player.onlineStats.ratio.toFixed(2) + "s"}

@@ -149,7 +155,7 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
-
Mastermind
+

{dailyMastermindStats !== null ? (dailyMastermindStats.tab.length !== 0 ? dailyMastermindStats.tab.map((stats: any, index: number) => ( <> @@ -163,13 +169,13 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { )) : ( -

Nothing for the moment

+

)) : ( -

Nothing for the moment

+

)}
-
Enigme facile
+

{dailyEasyEnigmaStats !== null ? (dailyEasyEnigmaStats.tab.length !== 0 ? dailyEasyEnigmaStats.tab.map((stats: any, index: number) => ( <> @@ -183,13 +189,13 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { )) : ( -

Nothing for the moment

+

)) : ( -

Nothing for the moment

+

)}
-
Enigme moyenne
+

{dailyMediumEnigmaStats !== null ? (dailyMediumEnigmaStats.tab.length !== 0 ? dailyMediumEnigmaStats.tab.map((stats: any, index: number) => ( <> @@ -203,13 +209,13 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { )) : ( -

Nothing for the moment

+

)) : ( -

Nothing for the moment

+

)}
-
Enigme difficile
+

{dailyHardEnigmaStats !== null ? (dailyHardEnigmaStats.tab.length !== 0 ? dailyHardEnigmaStats.tab.map((stats: any, index: number) => ( <> @@ -223,13 +229,13 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { )) : ( -

Nothing for the moment

+

)) : ( -

Nothing for the moment

+

)}
-
En ligne
+

{dailyOnlineStats !== null ? (dailyOnlineStats.tab.length !== 0 ? dailyOnlineStats.tab.map((stats: any, index: number) => ( <> @@ -243,9 +249,9 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { )) : ( -

Nothing for the moment

+

)) : ( -

Nothing for the moment

+

)}
@@ -255,7 +261,7 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
-
Mastermind
+

{weeklyMastermindStats !== null ? (weeklyMastermindStats.tab.length !== 0 ? weeklyMastermindStats.tab.map((stats: any, index: number) => ( <> @@ -269,13 +275,13 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { )) : ( -

Nothing for the moment

+

)) : ( -

Nothing for the moment

+

)}
-
Enigme facile
+

{weeklyEasyEnigmaStats !== null ? (weeklyEasyEnigmaStats.tab.length !== 0 ? weeklyEasyEnigmaStats.tab.map((stats: any, index: number) => ( <> @@ -289,13 +295,13 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { )) : ( -

Nothing for the moment

+

)) : ( -

Nothing for the moment

+

)}
-
Enigme moyenne
+

{weeklyMediumEnigmaStats !== null ? (weeklyMediumEnigmaStats.tab.length !== 0 ? weeklyMediumEnigmaStats.tab.map((stats: any, index: number) => ( <> @@ -309,13 +315,13 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { )) : ( -

Nothing for the moment

+

)) : ( -

Nothing for the moment

+

)}
-
Enigme difficile
+

{weeklyHardEnigmaStats !== null ? (weeklyHardEnigmaStats.tab.length !== 0 ? weeklyHardEnigmaStats.tab.map((stats: any, index: number) => ( <> @@ -329,13 +335,13 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { )) : ( -

Nothing for the moment

+

)) : ( -

Nothing for the moment

+

)}
-
En ligne
+

{weeklyOnlineStats !== null ? (weeklyOnlineStats.tab.length !== 0 ? weeklyOnlineStats.tab.map((stats: any, index: number) => ( <> @@ -349,9 +355,9 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => { )) : ( -

Nothing for the moment

+

)) : ( -

Nothing for the moment

+

)}
diff --git a/cryptide_project/src/Pages/Lobbies.tsx b/cryptide_project/src/Pages/Lobbies.tsx index 355bb61..02a6195 100644 --- a/cryptide_project/src/Pages/Lobbies.tsx +++ b/cryptide_project/src/Pages/Lobbies.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react'; + /* Style */ import './Lobbies.css'; import "../Style/Global.css" @@ -11,7 +12,7 @@ import { socket } from '../SocketConfig'; import JSONParser from '../JSONParser'; import Person from '../model/Person'; import { useNavigationType } from 'react-router-dom'; - +import { FormattedMessage, useIntl } from 'react-intl'; class LobbyDataProps { roomNum : string @@ -95,12 +96,16 @@ function Lobbies() { socket.emit("lobby created") } + + const intl = useIntl(); + + return(
setSearchTerm(e.target.value)} style={{width:'80%', margin:'10px'}} @@ -119,7 +124,7 @@ function Lobbies() { }} onClick={handleShowAllClick} > - Tous +
{filteredLobbiesToShow.length === 0 ? ( - + ) : (
{filteredLobbiesToShow.map((lobby, index) => ( diff --git a/cryptide_project/src/Pages/NewPlay.tsx b/cryptide_project/src/Pages/NewPlay.tsx index 27e2153..3e6d041 100644 --- a/cryptide_project/src/Pages/NewPlay.tsx +++ b/cryptide_project/src/Pages/NewPlay.tsx @@ -31,6 +31,7 @@ import Button from 'react-bootstrap/Button'; import ButtonGroup from 'react-bootstrap/ButtonGroup'; import Lobbies from './Lobbies'; import {basePath} from "../AdressSetup" +import { FormattedMessage } from 'react-intl'; @@ -203,8 +204,8 @@ function NewPlay() {
{/* Boutons pour jouer */}
- - + + {({ placement, arrowProps, show: _show, popper, ...props }) => (
- - + + +
)}
- - - {/* */} - {/* {goBackRoom != -1 && } */} - + + +
diff --git a/cryptide_project/src/Translations/en.json b/cryptide_project/src/Translations/en.json index 96300b6..3d7db75 100644 --- a/cryptide_project/src/Translations/en.json +++ b/cryptide_project/src/Translations/en.json @@ -68,14 +68,40 @@ "sport_start": "The suspect plays at least", "sport_end": "", - - - - - - - - + "navbar.play" : "Play", + "navbar.presentation":"Presentation", + "navbar.info":"Information", + + "play.jouerseul": "Play alone", + "play.enigme": "Solve an enigma", + "play.enigme.easy": "Easy", + "play.enigme.medium": "Intermediate", + "play.enigme.hard": "Hard", + + "play.create": "Create a game", + "play.tuto": "Tutorial", + "play.return": "Return to game", + + "lobbies.all":"All", + "lobbies.dispo":"Disponible", + + "placeholder.searchLobby": "Search for a lobby...", + + "score.nbPlayed": "Games Played", + "score.best": "Best Score", + "score.moy": "Average Attempts", + "score.NbWin": "Number of Wins", + "score.ratio": "Win/Loss Ratio", + "score.bestTmp": "Best Time", + "score.moyTmp": "Average Time", + "score.nothing": "Nothing for the moment", + + "score.titre.easy": "Easy Enigma", + "score.titre.int": "Intermediate Enigma", + "score.titre.hard": "Hard Enigma", + "score.online": "Online", + + "score.tab.stat" : "Your Stats", "informations" : "Information", diff --git a/cryptide_project/src/Translations/es.json b/cryptide_project/src/Translations/es.json index f63c4a1..0782f1a 100644 --- a/cryptide_project/src/Translations/es.json +++ b/cryptide_project/src/Translations/es.json @@ -67,6 +67,11 @@ "sport_start": "El sospechoso juega al menos", "sport_end": "", + "navbar.play" : "Jugar", + "navbar.presentation":"Presentación", + "navbar.info":"Información", + + "informations": "Información", "info.intro.title": "Introducción al juego:", "info.intro.text": "¡Bienvenido a nuestro emocionante juego de deducción, donde la intriga y la travesura se combinan en una emocionante aventura! Sumérgete en un mundo de misterio e intriga, donde cada interacción cuenta y cada pista te acerca a la verdad. Imagina un gráfico complejo donde cada vértice representa a una persona, cada eje una relación, y cada detalle cuenta. Te sumerges en un desafiante reto para descubrir quién entre estas personas es el misterioso asesino. Cada jugador tiene una pista crucial y solo el intercambio estratégico de estas pistas te llevará a resolver el misterio. Explora nuestra página de reglas para entender las complejidades del juego, descubre pistas que pueden guiarte y desarrolla estrategias inteligentes para identificar al culpable. ¡Manipula a tus amigos para ser el primero en descubrir quién es el asesino oculto en el gráfico! ¿Estás listo para aceptar el desafío y desenmascarar al asesino oculto en el gráfico? ¡Que comience la investigación!", diff --git a/cryptide_project/src/Translations/fr.json b/cryptide_project/src/Translations/fr.json index 56f6d00..7c1b7ce 100644 --- a/cryptide_project/src/Translations/fr.json +++ b/cryptide_project/src/Translations/fr.json @@ -67,15 +67,40 @@ "sport_start": "Le suspect pratique au moins du", "sport_end": "", - - - - - - - - - + "navbar.play" : "Jouer", + "navbar.presentation":"Présentation", + "navbar.info":"Informations", + + "play.jouerseul": "Jouer seul", + "play.enigme": "Résoudre une énigme", + "play.enigme.easy": "Facile", + "play.enigme.medium": "Intermédiaire", + "play.enigme.hard": "Difficile", + + "play.create":"Créer une partie", + "play.tuto": "Tutoriel", + "play.return": "Retourner à la partie", + + "lobbies.all":"Tous", + "lobbies.dispo":"Disponibles", + + "placeholder.searchLobby": "Rechercher un lobby...", + + "score.nbPlayed" : "Parties Jouées", + "score.best" : "Best-Score", + "score.moy" : "Moyenne d'essai", + "score.NbWin" : "Nombre de victoire", + "score.ratio" : "Ratio V/D", + "score.bestTmp" : "Meilleur temps", + "score.moyTmp" : "Moyenne de temps", + "score.nothing" : "Rien pour le moment", + + "score.titre.easy" : "Énigme facile", + "score.titre.int" : "Énigme intermédiaire", + "score.titre.hard" : "Énigme difficile", + "score.online" : "En ligne", + + "score.tab.stat" : "Vos Stats", "informations" : "Informations", "info.intro.title":"Introduction au jeu :", diff --git a/cryptide_project/src/Translations/pt.json b/cryptide_project/src/Translations/pt.json index a6b93fc..f6c0c83 100644 --- a/cryptide_project/src/Translations/pt.json +++ b/cryptide_project/src/Translations/pt.json @@ -68,6 +68,12 @@ "sport_start": "O suspeito joga pelo menos", "sport_end": "", + "navbar.play" : "Jogar", + "navbar.presentation":"Apresentação", + "navbar.info":"Informação", + + + "informations" : "Informação", "info.intro.title":"Introdução ao jogo:", "info.intro.text":"Bem-vindo ao nosso empolgante jogo de dedução, onde intriga e malícia se unem em uma aventura emocionante! Mergulhe em um mundo de mistério e intriga, onde cada interação conta, e cada pista o aproxima da verdade. Imagine um gráfico complexo onde cada vértice representa uma pessoa, cada eixo uma relação, e cada detalhe conta. Você está imerso em um desafio desafiador para descobrir quem, entre esses indivíduos, é o misterioso assassino. Cada jogador tem uma pista crucial, e apenas o compartilhamento estratégico dessas pistas o levará a resolver o mistério. Explore nossa página de regras para entender as complexidades do jogo, descobrir pistas que podem orientá-lo e desenvolver estratégias inteligentes para identificar o culpado. Manipule seus amigos para ser o primeiro a descobrir quem é o assassino escondido no gráfico. Você está pronto para aceitar o desafio e desmascarar o assassino oculto no gráfico? Que a investigação comece!", diff --git a/cryptide_project/src/Translations/ru.json b/cryptide_project/src/Translations/ru.json index 6bdce8c..a85d796 100644 --- a/cryptide_project/src/Translations/ru.json +++ b/cryptide_project/src/Translations/ru.json @@ -68,6 +68,11 @@ "sport_start": "Подозреваемый играет по меньшей мере в", "sport_end": "", + "navbar.play" : "Разыграть", + "navbar.presentation":"Презентационный", + "navbar.info":"Информация", + + "informations" : "Информация", "info.intro.title":"Введение в игру :", -- 2.36.3 From 34a53d016fe3faf7b96ecea9765334b0bf2dfe3b Mon Sep 17 00:00:00 2001 From: Pierre Ferreira Date: Wed, 13 Dec 2023 15:49:36 +0100 Subject: [PATCH 2/8] ajout des traduction fr et en sur le lobby :boom: --- .../src/Components/PlayerItemList.tsx | 7 ++++--- cryptide_project/src/Pages/Lobby.tsx | 20 +++++++++---------- cryptide_project/src/Translations/en.json | 9 +++++++++ cryptide_project/src/Translations/fr.json | 19 ++++++++++++++++++ 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/cryptide_project/src/Components/PlayerItemList.tsx b/cryptide_project/src/Components/PlayerItemList.tsx index 4fcb752..5086f1e 100644 --- a/cryptide_project/src/Components/PlayerItemList.tsx +++ b/cryptide_project/src/Components/PlayerItemList.tsx @@ -20,6 +20,7 @@ import Bot from '../model/Bot'; /* server */ import { socket } from '../SocketConfig'; +import { Form } from 'react-router-dom'; interface MyPlayerItemListProps { player : Player, @@ -58,13 +59,13 @@ const PlayerItemList:React.FC =({ player, room }) => { {isBot && ( - Facile + - Intermédiaire + - Fort + )} diff --git a/cryptide_project/src/Pages/Lobby.tsx b/cryptide_project/src/Pages/Lobby.tsx index df747cd..6984d08 100644 --- a/cryptide_project/src/Pages/Lobby.tsx +++ b/cryptide_project/src/Pages/Lobby.tsx @@ -48,6 +48,7 @@ import Overlay from 'react-bootstrap/Overlay'; import { DataSet } from 'vis-network'; import {basePath} from "../AdressSetup" +import { FormattedMessage } from 'react-intl'; let gameStarted = false @@ -192,17 +193,14 @@ function Lobby() { }); socket.on("room full", () => { - //TODO POP UP pour quand la room est pleine navigate(`${basePath}/`) }) socket.on("game started", () => { - //TODO POP UP pour quand la room est pleine navigate(`${basePath}/`) }) socket.on("game already started", () => { - //TODO POP UP pour quand la room est pleine navigate(`${basePath}/`) }) @@ -277,9 +275,9 @@ function Lobby() {
{players.length == 6 ? ( -

6/6 Players

+

6/6

) : ( -

{players.length}/6 Players

+

{players.length}/6

) }
@@ -308,11 +306,11 @@ function Lobby() {
-

Bienvenue dans votre lobby !

-

Attendez que tous vos amis rejoignent avant de lancer la partie.

+

+

{/* Bouton pour copier le lien */} {({ @@ -334,13 +332,13 @@ function Lobby() { ...props.style, }} > - Lien copié +
)}
- +
@@ -366,7 +364,7 @@ function Lobby() { width: 'auto', height: 'auto' }}> - Démarrer la partie ! +
diff --git a/cryptide_project/src/Translations/en.json b/cryptide_project/src/Translations/en.json index 3d7db75..9c67646 100644 --- a/cryptide_project/src/Translations/en.json +++ b/cryptide_project/src/Translations/en.json @@ -103,6 +103,15 @@ "score.tab.stat" : "Your Stats", + "lobby.players" : "Players", + "lobby.bienvenue": "Welcome to your lobby!", + "lobby.wait": "Wait for all your friends to join before starting the game.", + "lobby.invite": "Invite friends", + "lobby.copyLink": "Link copied", + "lobby.nbNode": "Select the number of nodes (between 20 and 60)", + "lobby.start": "Start the game!", + + "informations" : "Information", "info.intro.title":"Introduction to the game :", diff --git a/cryptide_project/src/Translations/fr.json b/cryptide_project/src/Translations/fr.json index 7c1b7ce..191eb73 100644 --- a/cryptide_project/src/Translations/fr.json +++ b/cryptide_project/src/Translations/fr.json @@ -71,6 +71,15 @@ "navbar.presentation":"Présentation", "navbar.info":"Informations", + + "easy" : "Facile", + "hard" : "Difficile", + "medium" : "Intermédiaire", + "strong" : "Fort", + "weak" : "Faible", + "none" : "Aucun", + + "play.jouerseul": "Jouer seul", "play.enigme": "Résoudre une énigme", "play.enigme.easy": "Facile", @@ -102,6 +111,16 @@ "score.tab.stat" : "Vos Stats", + "lobby.players" : "Joueurs", + "lobby.bienvenue" : "Bienvenue dans votre lobby !", + "lobby.wait" : "Attendez que tous vos amis rejoignent avant de lancer la partie.", + "lobby.invite" : "Inviter des amis", + "lobby.copyLink" : "Lien copié", + "lobby.nbNode" : "Sélectionner le nombre de noeud (entre 20 et 60) ", + "lobby.start" : "Démarrer la partie !", + + + "informations" : "Informations", "info.intro.title":"Introduction au jeu :", "info.intro.text":"Bienvenue dans notre jeu de déduction captivant, où l'intrigue et la malice se rejoignent dans une aventure palpitante ! Plongez-vous dans un monde de mystère et d'intrigue, où chaque interaction compte, et chaque indice vous rapproche de la vérité.Imaginez un graphique complexe où chaque sommet représente une personne, chaque axe une relation, et chaque détail compte. Vous êtes plongé dans un défi stimulant pour découvrir qui parmi ces individus est le mystérieux coupable. Chaque joueur détient un indice crucial, et seul le partage stratégique de ces indices vous mènera à la résolution du mystère. Explorez notre page de règles pour comprendre les subtilités du jeu, découvrez les indices qui peuvent vous guider, et élaborez des stratégies intelligentes pour identifier le coupable. Manipuler vos amis, afin d'être le premier à découvrir qui est le meurtrier ! Êtes-vous prêt à relever le défi et à démasquer le coupable caché dans le graphe ? Que l'enquête commence !", -- 2.36.3 From edb90ea92689a9db45240d74a9bac5c8426da354 Mon Sep 17 00:00:00 2001 From: Pierre Ferreira Date: Wed, 13 Dec 2023 16:29:20 +0100 Subject: [PATCH 3/8] :globe_with_meridians: toujours plus de trad :globe_with_meridians: --- cryptide_project/src/Pages/InGame.tsx | 2 +- cryptide_project/src/Translations/en.json | 2 ++ cryptide_project/src/Translations/es.json | 1 + cryptide_project/src/Translations/fr.json | 3 +-- cryptide_project/src/Translations/pt.json | 1 + cryptide_project/src/Translations/ru.json | 2 +- 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cryptide_project/src/Pages/InGame.tsx b/cryptide_project/src/Pages/InGame.tsx index 4a0d8d2..8fb887e 100644 --- a/cryptide_project/src/Pages/InGame.tsx +++ b/cryptide_project/src/Pages/InGame.tsx @@ -375,7 +375,7 @@ const InGame = ({locale, changeLocale}) => { backgroundColor: theme.colors.primary, borderColor: theme.colors.secondary }}> - Tour : {cptTour} + : {cptTour}
} diff --git a/cryptide_project/src/Translations/en.json b/cryptide_project/src/Translations/en.json index 9c67646..9d9756e 100644 --- a/cryptide_project/src/Translations/en.json +++ b/cryptide_project/src/Translations/en.json @@ -72,6 +72,8 @@ "navbar.presentation":"Presentation", "navbar.info":"Information", + "round" : "Round", + "play.jouerseul": "Play alone", "play.enigme": "Solve an enigma", "play.enigme.easy": "Easy", diff --git a/cryptide_project/src/Translations/es.json b/cryptide_project/src/Translations/es.json index 0782f1a..c27982e 100644 --- a/cryptide_project/src/Translations/es.json +++ b/cryptide_project/src/Translations/es.json @@ -71,6 +71,7 @@ "navbar.presentation":"Presentación", "navbar.info":"Información", + "round":"Vuelta", "informations": "Información", "info.intro.title": "Introducción al juego:", diff --git a/cryptide_project/src/Translations/fr.json b/cryptide_project/src/Translations/fr.json index 191eb73..c79cfc2 100644 --- a/cryptide_project/src/Translations/fr.json +++ b/cryptide_project/src/Translations/fr.json @@ -71,14 +71,13 @@ "navbar.presentation":"Présentation", "navbar.info":"Informations", - - "easy" : "Facile", "hard" : "Difficile", "medium" : "Intermédiaire", "strong" : "Fort", "weak" : "Faible", "none" : "Aucun", + "round" : "Tour", "play.jouerseul": "Jouer seul", "play.enigme": "Résoudre une énigme", diff --git a/cryptide_project/src/Translations/pt.json b/cryptide_project/src/Translations/pt.json index f6c0c83..c5d2d58 100644 --- a/cryptide_project/src/Translations/pt.json +++ b/cryptide_project/src/Translations/pt.json @@ -72,6 +72,7 @@ "navbar.presentation":"Apresentação", "navbar.info":"Informação", + "round":"ronda", "informations" : "Informação", diff --git a/cryptide_project/src/Translations/ru.json b/cryptide_project/src/Translations/ru.json index a85d796..65e17b8 100644 --- a/cryptide_project/src/Translations/ru.json +++ b/cryptide_project/src/Translations/ru.json @@ -72,7 +72,7 @@ "navbar.presentation":"Презентационный", "navbar.info":"Информация", - + "round" : "Раунд", "informations" : "Информация", "info.intro.title":"Введение в игру :", -- 2.36.3 From e7b0dfb9b4a3018be4333a7e86d1c95a6b8dc2b2 Mon Sep 17 00:00:00 2001 From: Pierre Ferreira Date: Thu, 14 Dec 2023 11:27:10 +0100 Subject: [PATCH 4/8] =?UTF-8?q?mise=20en=20place=20de=20la=20traducton=20s?= =?UTF-8?q?ur=20les=20pages=20de=20jeu=20et=20sur=20la=20premi=C3=A8re=20p?= =?UTF-8?q?artie=20du=20tuto=20:memo:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Components/GraphContainer.tsx | 20 ++-- cryptide_project/src/Components/TurnBar.tsx | 1 - .../src/Components/TutorialGraph.tsx | 10 +- cryptide_project/src/Pages/InGame.tsx | 8 +- cryptide_project/src/Pages/Tutorial.tsx | 93 ++++++++++--------- cryptide_project/src/Translations/en.json | 16 +++- cryptide_project/src/Translations/fr.json | 87 ++++++++++++++++- 7 files changed, 169 insertions(+), 66 deletions(-) diff --git a/cryptide_project/src/Components/GraphContainer.tsx b/cryptide_project/src/Components/GraphContainer.tsx index a664541..78a90ed 100644 --- a/cryptide_project/src/Components/GraphContainer.tsx +++ b/cryptide_project/src/Components/GraphContainer.tsx @@ -21,6 +21,7 @@ import { json } from "body-parser"; import html2canvas from 'html2canvas'; import jsPDF from 'jspdf'; import {basePath} from "../AdressSetup" +import { useIntl } from "react-intl"; interface MyGraphComponentProps { onNodeClick: (shouldShowChoiceBar: boolean) => void; @@ -88,6 +89,11 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS //* Gestion du temps : let initMtn = 0 + + //* traduction + const intl = useIntl(); + + const {isLoggedIn, user, manager} = useAuth(); const { indices, indice, person, personNetwork, setNodeIdData, players, setPlayersData, askedPersons, setActualPlayerIndexData, room, actualPlayerIndex, turnPlayerIndex, setTurnPlayerIndexData, setWinnerData, dailyEnigme, setNbCoupData, settempsData, setNetworkDataData, setSeedData, nodesC, temps} = useGame(); const params = new URLSearchParams(window.location.search); @@ -319,8 +325,8 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS }) } setActualPlayerIndexData(index) - if (playerIndex == actualPlayerIndex){ - handleTurnBarTextChange("À vous de jouer") + if (playerIndex == actualPlayerIndex){ + handleTurnBarTextChange(intl.formatMessage({ id: 'game.yourTurn' })) handleShowTurnBar(true) } } @@ -513,7 +519,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS setPlayerIndex(playerIndex) setLastIndex(playerIndex) if (playerIndex===actualPlayerIndex){ - handleTurnBarTextChange("À vous de jouer") + handleTurnBarTextChange(intl.formatMessage({ id: 'game.yourTurn' })) handleShowTurnBar(true) } } @@ -534,7 +540,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS setPlayerIndex(index) setLastIndex(index) if (actualPlayerIndex==index){ - handleTurnBarTextChange("À vous de jouer") + handleTurnBarTextChange(intl.formatMessage({ id: 'game.yourTurn' })) handleShowTurnBar(true) } }) @@ -602,7 +608,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS } if (playerIndex === actualPlayerIndex){ - handleTurnBarTextChange("À vous de jouer") + handleTurnBarTextChange(intl.formatMessage({ id: 'game.yourTurn' })) handleShowTurnBar(true) } else{ @@ -647,7 +653,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS setAskedWrong(true) askedWrongBot=true handleShowTurnBar(true) - handleTurnBarTextChange("Mauvais choix, posez un carré !") + handleTurnBarTextChange(intl.formatMessage({ id: 'game.wrong' })) touchedPlayer = actualPlayerIndex putGreyBackgroud() } @@ -669,7 +675,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS setPlayerIndex(playerIndex) setLastIndex(playerIndex) if (playerIndex === actualPlayerIndex){ - handleTurnBarTextChange("À vous de jouer") + handleTurnBarTextChange(intl.formatMessage({ id: 'game.yourTurn' })) handleShowTurnBar(true) } else{ diff --git a/cryptide_project/src/Components/TurnBar.tsx b/cryptide_project/src/Components/TurnBar.tsx index 53df6d4..d72d03c 100644 --- a/cryptide_project/src/Components/TurnBar.tsx +++ b/cryptide_project/src/Components/TurnBar.tsx @@ -12,7 +12,6 @@ const TurnBar: React.FC = ({text})=> { style={{ borderColor: theme.colors.secondary }}> - {/* texte changeable et a traduire */}

{text}

); diff --git a/cryptide_project/src/Components/TutorialGraph.tsx b/cryptide_project/src/Components/TutorialGraph.tsx index c9190d1..12317b7 100644 --- a/cryptide_project/src/Components/TutorialGraph.tsx +++ b/cryptide_project/src/Components/TutorialGraph.tsx @@ -22,6 +22,7 @@ import html2canvas from 'html2canvas'; import jsPDF from 'jspdf'; import {basePath} from "../AdressSetup" import PersonNetwork from "../model/PersonsNetwork"; +import { useIntl } from "react-intl"; interface TutorialGraphProps { setNetwork: (network: Network) => void @@ -53,6 +54,9 @@ const TutorialGraph: React.FC = ({showLast, setNetwork, setP //* Gestion du temps : let initMtn = 0 + //* traduction + const intl = useIntl(); + const {isLoggedIn, user, manager} = useAuth(); const {setIndiceData, setIndicesData, setActualPlayerIndexData, setWinnerData, setPlayersData, setNetworkDataData, setPersonData} = useGame(); const params = new URLSearchParams(window.location.search); @@ -63,7 +67,7 @@ const TutorialGraph: React.FC = ({showLast, setNetwork, setP if (first){ first = false setActualPlayerIndexData(0) - handleTurnBarTextChange("C'est à vous de jouer !") + handleTurnBarTextChange(intl.formatMessage({ id: 'game.yourTurn' })) handleShowTurnBar(true) } @@ -234,7 +238,7 @@ const TutorialGraph: React.FC = ({showLast, setNetwork, setP nodes.update({id: node.id, label: node.label + positionToEmoji(2, false)}) setPlayerTouched(-1) displayModalstep(2); - handleTurnBarTextChange("Mauvais choix, posez un carré !") + handleTurnBarTextChange(intl.formatMessage({ id: 'game.wrong' })) const tabGrey = [7, 0, 4, 1, 8] for (const id of tabGrey){ const node = nodes.get().find((n: NodePerson) => n.id === id) @@ -272,7 +276,7 @@ const TutorialGraph: React.FC = ({showLast, setNetwork, setP if (node4 === undefined)return; nodes.update({id: node4.id, label: node4.label + positionToEmoji(2, false)}) setPlayerIndex(0) - handleTurnBarTextChange("A vous de jouer !") + handleTurnBarTextChange(intl.formatMessage({ id: 'game.yourTurn' })) handleShowTurnBar(true) setTutoStep(3) displayModalstep(3); diff --git a/cryptide_project/src/Pages/InGame.tsx b/cryptide_project/src/Pages/InGame.tsx index 8fb887e..0c533e9 100644 --- a/cryptide_project/src/Pages/InGame.tsx +++ b/cryptide_project/src/Pages/InGame.tsx @@ -375,7 +375,7 @@ const InGame = ({locale, changeLocale}) => { backgroundColor: theme.colors.primary, borderColor: theme.colors.secondary }}> - : {cptTour} + : {cptTour} } @@ -500,7 +500,7 @@ const InGame = ({locale, changeLocale}) => { backdrop={false} style={{ height: '20%', width: '25%', top: '60vh' }}> - Indice + {indice?.ToString(locale)} @@ -515,12 +515,12 @@ const InGame = ({locale, changeLocale}) => { placement='top' style={{height: '30%', width: '30%', left: '70%' }}> - param Paramètres + param diff --git a/cryptide_project/src/Pages/Tutorial.tsx b/cryptide_project/src/Pages/Tutorial.tsx index 113f51e..1d9637c 100644 --- a/cryptide_project/src/Pages/Tutorial.tsx +++ b/cryptide_project/src/Pages/Tutorial.tsx @@ -56,6 +56,7 @@ import TutorialGraph from '../Components/TutorialGraph'; import { useAuth } from '../Contexts/AuthContext'; import EasyBot from '../model/EasyBot'; import { set } from 'lodash'; +import { FormattedMessage } from 'react-intl'; let cptNavigation = 0 @@ -362,7 +363,7 @@ const Tutorial = ({locale, changeLocale}) => { */} - Les règles du jeu + - Ce bouton vous mène à la page d'information du jeu, avec toutes les règles du jeu, que ce soit les objectifs, les indices, le déroulement, etc. + @@ -540,9 +541,9 @@ const Tutorial = ({locale, changeLocale}) => { - L'indice + - Ce bouton vous permet d'afficher votre indice personnel, gardez le secret ! Il s'agit de votre meilleur atout pour gagner. + @@ -552,13 +553,13 @@ const Tutorial = ({locale, changeLocale}) => { - Place à la pratique ! + - Bien joué ! Vous avez maintenanttoutes les bases d'un veritable détéctive. +
- Vous allez à présent avoir un exercice pratique pour la résolution d'une enquête, au côté de ces très chère Batman et Scooby-Doo. +
- Cliquer sur "Poursuivre" pour commencer votre première partie. +
@@ -569,11 +570,11 @@ const Tutorial = ({locale, changeLocale}) => {
- +
- { step != -1 && ()} - { step === 6 ? () : - } + { step != -1 && ()} + { step === 6 ? () : + }
@@ -586,25 +587,25 @@ const Tutorial = ({locale, changeLocale}) => { size="lg" style={{ maxHeight: '100vh'}}> - Tutoriel + - Premier pas + - Bienvenue dans cette seconde partie, où nous allons apprendre le déroulé d'une veritable enquête. +
- Dans un premier temps, sélectionnez le joueur Scooby-Doo et questionnez le à propos du suspect nommé Violet en cliquant sur cette dernière. + Scooby-DooViolet
- + @@ -616,7 +617,7 @@ const Tutorial = ({locale, changeLocale}) => { size="lg" style={{ maxHeight: '100vh'}}> - Tutoriel + {step === 0 && ( @@ -685,7 +686,7 @@ const Tutorial = ({locale, changeLocale}) => { size="lg" style={{ maxHeight: '100vh'}}> - Tutoriel + diff --git a/cryptide_project/src/Translations/en.json b/cryptide_project/src/Translations/en.json index 9d9756e..f79839d 100644 --- a/cryptide_project/src/Translations/en.json +++ b/cryptide_project/src/Translations/en.json @@ -26,6 +26,11 @@ "sign_up":" Sign up ", "log_out":" Log out ", + "indice":"Hint", + "param":"Settings", + "sfx":"Activate SFX", + "aide":"Help", + "join" : "Join", "create_room" : "Create room", "play_solo" : "Single player", @@ -72,7 +77,9 @@ "navbar.presentation":"Presentation", "navbar.info":"Information", - "round" : "Round", + "turn" : "Round", + "square":"square", + "round":"round", "play.jouerseul": "Play alone", "play.enigme": "Solve an enigma", @@ -113,7 +120,8 @@ "lobby.nbNode": "Select the number of nodes (between 20 and 60)", "lobby.start": "Start the game!", - + "game.yourTurn":"It's your turn !", + "game.wrong":"Wrong choice, put a square !", "informations" : "Information", "info.intro.title":"Introduction to the game :", @@ -202,5 +210,7 @@ "info.mdj.enigme.medium": "Intermediate Enigma", "info.mdj.enigme.medium.txt": "In this game mode, you don't have access to clues, but you have just enough information about some suspects to be able to guess the culprit. This information will help you guess the clues, and the culprit is the suspect for whom all the clues match. If you select the wrong suspect, don't worry! You'll have information about that suspect, making it easier for you to find the culprit. The goal is to find the culprit in the minimum number of guesses.", "info.mdj.enigme.hard": "Hard Enigma", - "info.mdj.enigme.hard.txt": "This final variant is similar to the intermediate enigma; however, you must find the culprit on the first try, or you lose! It's up to you to play! The goal is to find the culprit in the minimum amount of time." + "info.mdj.enigme.hard.txt": "This final variant is similar to the intermediate enigma; however, you must find the culprit on the first try, or you lose! It's up to you to play! The goal is to find the culprit in the minimum amount of time.", + + "tutorial.title": "Tutorial" } \ No newline at end of file diff --git a/cryptide_project/src/Translations/fr.json b/cryptide_project/src/Translations/fr.json index c79cfc2..3cb819a 100644 --- a/cryptide_project/src/Translations/fr.json +++ b/cryptide_project/src/Translations/fr.json @@ -26,6 +26,13 @@ "sign_up":" S'inscrire ", "log_out":" Se déconnecter ", + "indice":"Indice", + "param":"Paramètres", + "sfx":"Activer les SFX", + + "aide":"Aide", + + "majUn":"Un", "join" : "Rejoindre", "create_room" : "Créer une partie", @@ -77,7 +84,22 @@ "weak" : "Faible", "none" : "Aucun", - "round" : "Tour", + "turn" : "Tour", + "square":"carré", + "round":"rond", + + "step" : "Étape", + "previous" : "Précédent", + "next" : "Suivant", + "continue" : "Poursuivre", + "compris":"Compris !", + "close" : "Fermer", + + + "color.green":"Vert", + "color.blue":"Bleu", + "color.red":"Rouge", + "color.yellow":"Jaune", "play.jouerseul": "Jouer seul", "play.enigme": "Résoudre une énigme", @@ -119,6 +141,8 @@ "lobby.start" : "Démarrer la partie !", + "game.yourTurn":"À vous de jouer !", + "game.wrong":"Mauvais choix, posez un carré !", "informations" : "Informations", "info.intro.title":"Introduction au jeu :", @@ -208,5 +232,64 @@ "info.mdj.enigme.medium":"L'énigme intermédiaire", "info.mdj.enigme.medium.txt":"Dans ce mode de jeu, vous n'avez pas accès au indice, mais vous avez juste assez d'informations sur certains suspects pour pouvoir deviner le coupable. Ces informations vont vous permettre de deviner les indices, et le coupable est le suspect pour lequel tous les indices correspondent. Si jamais vous sélectionnez le mauvais suspect, pas de panique ! Vous aurez les informations relatives à ce dernier, ce qui vous facilitera le travail pour trouver le coupable. L'objectif est donc de trouver le coupable en un minimum de coup.", "info.mdj.enigme.hard":"L'énigme difficile", - "info.mdj.enigme.hard.txt":"Cette dernière variante est similaire à l'énigme intermédiaire, cependant, il faudra trouver du premier coup sinon, vous aurez perdu ! À vous de jouer ! L'objectif est donc de trouver le coupable en un minimum de temps." + "info.mdj.enigme.hard.txt":"Cette dernière variante est similaire à l'énigme intermédiaire, cependant, il faudra trouver du premier coup sinon, vous aurez perdu ! À vous de jouer ! L'objectif est donc de trouver le coupable en un minimum de temps.", + + "tutorial.title":"Tutoriel", + "tuto.title.1":"Bienvenue dans SocialGraph !", + "tuto.txt.1.1":"Vous incarnez un détective assoiffé de gloire, confronté à un crime.", + "tuto.txt.1.2":"Cependant, d'autres enquêteurs sont également sur le coup, tous cherchant à décrocher le titre de meilleur détective du monde.", + "tuto.txt.1.3":"Chacun possède un indice crucial pour identifier le coupable, il va falloir déduire l'indice de vos concurrents si vous souhaitez l'emporter !", + "tuto.txt.1.4":"Interrogez vos concurrents pour obtenir des réponses par oui ou non, mais méfiez-vous, un refus a des conséquences.", + "tuto.txt.1.5":"Soyez le premier à déduire les indices des autres et à trouver le coupable pour remporter la reconnaissance tant convoitée.", + "tuto.txt.1.6":"Si vous avez le moindre doute, cliquer sur le bouton 'aide' pour afficher l'étape actuel du tuto", + + "tuto.title.2":"Les Suspects", + "tuto.txt.2.1":"Voici comment est représenté un suspect, chaque suspect possède différentes caractéristiques, que ce soit leur nom, âge, sport et leur couleur de cheveux.", + "tuto.txt.2.2":"Par exemple, ici, nous avons ", + "tuto.txt.2.2.1":", qui a ", + "tuto.txt.2.2.2":", qui pratique du ", + "tuto.txt.2.2.3":" et du ", + "tuto.txt.2.2.4":", qui a les cheveux ", + "tuto.txt.2.2.5":" et qui possède ", + + "tuto.title.3":"Les indices", + "tuto.txt.3.1":"Dans ce jeu, chaque détective possède un indice, qui permet d'identifier une caractéristique du coupable, votre indice est le suivant :", + "tuto.txt.3.2":"Le suspect a entre 20 et 29 ans", + + "tuto.title.4":"Les Détectives", + "tuto.txt.4.1":"Il est possible de voir les détectives sur le côté gauche de l'écran, ils sont représentés par des cercles de couleurs différentes. Le contour carré signifie que ce détective est en pleine réflexion.", + "tuto.txt.4.2":"Pour interroger un détective à propos d'un suspect, il suffit de le sélectionner, puis de cliquer sur le suspect que vous souhaitez. Il vous répondra donc ce qu'il pense de ce suspect selon son indice.", + + "tuto.title.5":"Les réponses", + "tuto.txt.5.1":"Les détéctives vous répondrons que par des ronds ou des carrés de leur couleur.", + "tuto.txt.5.2":" signifie que son indice innocente le suspect", + "tuto.txt.5.3":" signifie que son indice peut incréminer le suspect", + "tuto.txt.5.4":"Par exemple, ici :", + "tuto.txt.5.5.1":"l'indice du détéctive Scooby-Doo ", + "tuto.txt.5.5.2":" permet d'innocenter Logan", + "tuto.txt.5.6":"Eleanor peut être suspectée par l'indice du détective Batman ", + "tuto.txt.5.7.1":"Evelyn est innocentée par l'indice de ", + "tuto.txt.5.7.2":"3 détéctive différents", + + "tuto.title.6":"Les règles du jeu", + "tuto.txt.6.1.1":"Ce bouton vous mène à la page d'", + "tuto.txt.6.1.2":"information du jeu", + "tuto.txt.6.1.3":", avec toutes les règles du jeu, que ce soit les objectifs, les indices, le déroulement, etc.", + + "tuto.title.7":"L'indice", + "tuto.txt.7.1":"Ce bouton vous permet d'afficher votre indice personnel, gardez le secret ! Il s'agit de votre meilleur atout pour gagner.", + + "tuto.title.8":"Place à la pratique !", + "tuto.txt.8.1":"Bien joué ! Vous avez maintenanttoutes les bases d'un veritable détéctive.", + "tuto.txt.8.2":"Vous allez à présent avoir un exercice pratique pour la résolution d'une enquête, au côté de ces très chère Batman et Scooby-Doo.", + "tuto.txt.8.3":"Cliquer sur 'Poursuivre' pour commencer votre première partie.", + + + "tuto.title.9":"Premier pas", + "tuto.txt.9.1":"Bienvenue dans cette seconde partie, où nous allons apprendre le déroulé d'une veritable enquête.", + "tuto.txt.9.2.1":"Dans un premier temps, sélectionnez le joueur ", + "tuto.txt.9.2.2":" et questionnez le à propos du suspect nommé ", + "tuto.txt.9.2.3":" en cliquant sur cette dernière.", + } + -- 2.36.3 From 8efeaca9d6449a8577b33423feaee184b3036503 Mon Sep 17 00:00:00 2001 From: Pierre Ferreira Date: Thu, 14 Dec 2023 14:31:04 +0100 Subject: [PATCH 5/8] finitions de la traduction du tuto en fr :globe_with_meridians: --- cryptide_project/src/Pages/Tutorial.tsx | 58 +++++++++++------------ cryptide_project/src/Translations/fr.json | 51 +++++++++++++++++++- 2 files changed, 77 insertions(+), 32 deletions(-) diff --git a/cryptide_project/src/Pages/Tutorial.tsx b/cryptide_project/src/Pages/Tutorial.tsx index 1d9637c..f7ea2e4 100644 --- a/cryptide_project/src/Pages/Tutorial.tsx +++ b/cryptide_project/src/Pages/Tutorial.tsx @@ -624,11 +624,11 @@ const Tutorial = ({locale, changeLocale}) => { - Votre premier tour + - Super, Violet a été identifié par l'indice de Scooby-Doo, c'est une information essentielle ! Cependant, cela ne signifie pas forcément qu'elle est coupable. +
- C'est à présent le tour aux autres joueurs de jouer, regardons ce qu'ils ont fait. +
@@ -638,15 +638,13 @@ const Tutorial = ({locale, changeLocale}) => { - Premier tour des autres joueurs + - Il semblerait que Scooby-Doo ait lui aussi interrogé Batman à propos de Violet, et que ce dernier ait répondu non par un carré. - Cela signifie que Violet n'est pas coupable, et qu'elle est donc innocente ! +
- Scooby-Doo a donc fait une erreur, en questionnant quelqu'un pouvant innocenter Violet. En guise de punition, il doit, lui aussi, poser un carré sur un autre joueur, révélant aussi plus d'information sur son indice. - Nous savons donc maintenant que l'indice de Scooby-Doo ne permet pas d'identifier Sebastian. +
- Ensuite, Batman a questionné Scooby-Doo à propos de Charlotte, qui est identifié par l'indice de Scooby-Doo. +
@@ -656,11 +654,11 @@ const Tutorial = ({locale, changeLocale}) => { - Second tour + - Vous remarquez que votre indice identifie lui aussi Charlotte, et si nous demandions à Batman, si ce dernier pense que Charlotte est la coupable ? +
- Cela nous permettrait donc de mettre fin à la partie ! +
@@ -670,11 +668,11 @@ const Tutorial = ({locale, changeLocale}) => {
- +
- { step != 0 && ()} - { step === 2 ? () : - } + { step != 0 && ()} + { step === 2 ? () : + }
@@ -693,19 +691,19 @@ const Tutorial = ({locale, changeLocale}) => { - La punition + - Mince, il semblerait que l'indice de Batman innocente Charlotte, et que vous avez donc commit une erreur, la punition s'applique ! +
- Vous devez donc poser un carré sur un autre joueur, révélant ainsi plus d'information sur votre indice. +
- Mais rien n'est joué ! Posons notre carré sur Liam pour cela, sélectionnez directement le suspect désiré. + Liam
- + @@ -717,35 +715,35 @@ const Tutorial = ({locale, changeLocale}) => { size="lg" style={{ maxHeight: '100vh'}}> - End Game + The End Game - La fin du jeu + - Ce tour est lui aussi riche en informations ! +
- Vous avez à présent assez d'information pour deviner les indices des autres : +
  • - Scooby-Doo semble avoir : {indices[1]?.ToString(locale)}. + {indices[1]?.ToString(locale)}.
  • - Batman semble avoir : {indices[2]?.ToString(locale)}. + {indices[2]?.ToString(locale)}.
  • - Et votre indice est : {indices[0]?.ToString(locale)}. + {indices[0]?.ToString(locale)}.
- Vous avez à présent toutes les cartes en main pour deviner qui est le coupable, cliquer sur le bouton Ask Everyone, puis séléctionné un suspect pour émettre une accusation pour deviner, bonne chance ! +
- + diff --git a/cryptide_project/src/Translations/fr.json b/cryptide_project/src/Translations/fr.json index 3cb819a..c8611b6 100644 --- a/cryptide_project/src/Translations/fr.json +++ b/cryptide_project/src/Translations/fr.json @@ -51,6 +51,10 @@ "redhead": "Roux", "brown": "Brun", + + "oui": "oui", + "non": "non", + "and": "et", "or": "ou", "or_sport": "ou du", @@ -269,7 +273,7 @@ "tuto.txt.5.5.2":" permet d'innocenter Logan", "tuto.txt.5.6":"Eleanor peut être suspectée par l'indice du détective Batman ", "tuto.txt.5.7.1":"Evelyn est innocentée par l'indice de ", - "tuto.txt.5.7.2":"3 détéctive différents", + "tuto.txt.5.7.2":"3 détéctives différents", "tuto.title.6":"Les règles du jeu", "tuto.txt.6.1.1":"Ce bouton vous mène à la page d'", @@ -280,7 +284,7 @@ "tuto.txt.7.1":"Ce bouton vous permet d'afficher votre indice personnel, gardez le secret ! Il s'agit de votre meilleur atout pour gagner.", "tuto.title.8":"Place à la pratique !", - "tuto.txt.8.1":"Bien joué ! Vous avez maintenanttoutes les bases d'un veritable détéctive.", + "tuto.txt.8.1":"Bien joué ! Vous avez maintenant toutes les bases d'un veritable détéctive.", "tuto.txt.8.2":"Vous allez à présent avoir un exercice pratique pour la résolution d'une enquête, au côté de ces très chère Batman et Scooby-Doo.", "tuto.txt.8.3":"Cliquer sur 'Poursuivre' pour commencer votre première partie.", @@ -291,5 +295,48 @@ "tuto.txt.9.2.2":" et questionnez le à propos du suspect nommé ", "tuto.txt.9.2.3":" en cliquant sur cette dernière.", + "tuto.title.10":"Votre premier tour", + "tuto.txt.10.1.1":"Super, ", + "tuto.txt.10.1.2":"Violet a été identifié par l'indice de Scooby-Doo", + "tuto.txt.10.1.3":", c'est une information essentielle ! Cependant, cela ne signifie ", + "tuto.txt.10.1.4":"pas forcément", + "tuto.txt.10.1.5":" qu'elle est coupable.", + "tuto.txt.10.2":"C'est à présent le tour aux autres joueurs de jouer, regardons ce qu'ils ont fait.", + + "tuto.title.11":"Premier tour des autres joueurs", + "tuto.txt.11.1.1":"Il semblerait que Scooby-Doo ait lui aussi interrogé Batman à propos de Violet, et que ce dernier ait répondu ", + "tuto.txt.11.1.2":" par un carré. Cela signifie que Violet n'est pas coupable, et qu'elle est donc innocente !", + "tuto.txt.11.2.1":"Scooby-Doo a donc fait une erreur, en questionnant quelqu'un pouvant innocenter Violet. En guise de ", + "tuto.txt.11.2.2":"punition", + "tuto.txt.11.2.3":", il doit, lui aussi, poser un carré sur un autre joueur, révélant aussi plus d'information sur son indice.Nous savons donc maintenant que l'indice de Scooby-Doo ne permet pas d'identifier Sebastian.", + "tuto.txt.11.3":"Ensuite, Batman a questionné Scooby-Doo à propos de Charlotte, qui est identifié par l'indice de Scooby-Doo.", + + "tuto.title.12":"Second tour", + "tuto.txt.12.1.1":"Vous remarquez que ", + "tuto.txt.12.1.2":"votre indice identifie lui aussi Charlotte", + "tuto.txt.12.1.3":", et si nous demandions à Batman, si ce dernier pense que Charlotte est la coupable ?", + "tuto.txt.12.2":"Cela nous permettrait donc de mettre fin à la partie !", + + "tuto.title.13":"La punition", + "tuto.txt.13.1.1":"Mince, il semblerait que l'indice de Batman innocente Charlotte, et que vous avez donc commit une erreur, la ", + "tuto.txt.13.1.2":"punition", + "tuto.txt.13.1.3":" s'applique !", + "tuto.txt.13.2.1":"Vous devez donc poser un ", + "tuto.txt.13.2.2":"carré sur un autre joueur", + "tuto.txt.13.2.3":", révélant ainsi plus d'information sur votre indice.", + "tuto.txt.13.3.1": "Mais rien n'est joué ! Posons notre carré sur ", + "tuto.txt.13.3.2": "pour cela, sélectionnez directement le suspect désiré.", + + "tuto.title.14":"La fin du jeu", + "tuto.txt.14.1":"Ce tour est lui aussi riche en informations !", + "tuto.txt.14.2":"Vous avez à présent assez d'information pour deviner les indices des autres : ", + "tuto.txt.14.3":"Scooby-Doo semble avoir : ", + "tuto.txt.14.4":"Batman semble avoir : ", + "tuto.txt.14.5":"Et votre indice est : ", + "tuto.txt.14.6.1":"Vous avez à présent toutes les cartes en main pour deviner qui est le coupable, cliquer sur le bouton ", + "tuto.txt.14.6.2":"Ask Everyone", + "tuto.txt.14.6.3":", puis séléctionné un suspect pour émettre une ", + "tuto.txt.14.6.4":"accusation", + "tuto.txt.14.6.5":" pour deviner, bonne chance !" } -- 2.36.3 From 0a6e5bba9a6dc73596d001834bf819d09fdfa12a Mon Sep 17 00:00:00 2001 From: Pierre Ferreira Date: Thu, 14 Dec 2023 15:06:02 +0100 Subject: [PATCH 6/8] traduction de l'historique en fr et en :memo: --- .../src/Components/GraphContainer.tsx | 16 ++- cryptide_project/src/Pages/InGame.tsx | 3 +- cryptide_project/src/Translations/en.json | 132 +++++++++++++++++- cryptide_project/src/Translations/fr.json | 9 +- 4 files changed, 149 insertions(+), 11 deletions(-) diff --git a/cryptide_project/src/Components/GraphContainer.tsx b/cryptide_project/src/Components/GraphContainer.tsx index 78a90ed..b611207 100644 --- a/cryptide_project/src/Components/GraphContainer.tsx +++ b/cryptide_project/src/Components/GraphContainer.tsx @@ -53,6 +53,8 @@ interface MyGraphComponentProps { putImposssibleGrey : () => void handleTurn :() => void + + lang: string } let lastAskingPlayer = 0 @@ -83,7 +85,7 @@ let testTemps = 0 let testFirst = false -const MyGraphComponent: React.FC = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, isDaily, isEasy, addToHistory, showLast, setNetwork, setNetworkEnigme, setPlayerIndex, askedWrong, setAskedWrong, importToPdf, setImportToPdf, importToJSON, setImportToJSON, setPutCorrectBackground, setPutGreyBackground, setPutImposssibleGrey, putCorrectBackground, putGreyBackground, putImposssibleGrey, handleTurn}) => { +const MyGraphComponent: React.FC = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, isDaily, isEasy, addToHistory, showLast, setNetwork, setNetworkEnigme, setPlayerIndex, askedWrong, setAskedWrong, importToPdf, setImportToPdf, importToJSON, setImportToJSON, setPutCorrectBackground, setPutGreyBackground, setPutImposssibleGrey, putCorrectBackground, putGreyBackground, putImposssibleGrey, handleTurn, lang}) => { let cptTour: number = 0 //* Gestion du temps : @@ -445,7 +447,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS if (firstHistory){ firstHistory=false indices.forEach((indice, index) => { - addToHistory("Indice " + positionToEmoji(index, true) + " : " + indice.ToString("fr")) + addToHistory(intl.formatMessage({ id: 'indice' }) + positionToEmoji(index, true) + " : " + indice.ToString(lang)) }) } @@ -603,7 +605,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS cptHistory++ if (cptHistory % 2 >= 0){ lastNodes.push(node) - addToHistory(testPlayers[askedIndex].pseudo + " à mis un " + positionToEmoji(askedIndex, works) + " à " + personNetwork.getPersons()[id].getName()) + addToHistory(testPlayers[askedIndex].pseudo + intl.formatMessage({ id: 'history.mis' }) + positionToEmoji(askedIndex, works) + intl.formatMessage({ id: 'à' }) + personNetwork.getPersons()[id].getName()) } } @@ -667,7 +669,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS cptBug=0 cptOnAskedWrong ++ if (cptOnAskedWrong % 2 >= 0){ - addToHistory(testPlayers[askingPlayer].pseudo + " ne peut plus poser de carré") + addToHistory(testPlayers[askingPlayer].pseudo + intl.formatMessage({ id: 'history.cantPose' })) playerIndex = askingPlayer + 1 if(playerIndex == players.length){ playerIndex = 0 @@ -735,7 +737,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS if (firstLap){ firstLap=false if (!isDaily){ - addToHistory("<----- [Tour " + 1 +"/"+networkData.nodes.length + "] ----->"); + addToHistory("<----- ["+ intl.formatMessage({ id: 'turn' }) +" " + 1 +"/"+networkData.nodes.length + "] ----->"); } } } @@ -1091,10 +1093,10 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS navigate(`${basePath}/endgame?solo=true&daily=${isDaily}`) } else{ - addToHistory(personTest.getName() + " n'est pas le coupable !"); //TODO préciser le nombre d'indice qu'il a de juste + addToHistory(personTest.getName() + intl.formatMessage({ id: 'history.NotCoupable' })); cptTour ++; // On Incrémente le nombre de tour du joueur const tour = cptTour+1; - addToHistory("<----- [Tour " + tour +"/"+networkData.nodes.length + "] ----->"); + addToHistory("<----- ["+ intl.formatMessage({ id: 'turn' }) + " " + tour +"/"+networkData.nodes.length + "] ----->"); changecptTour(cptTour); // On le transmet a la page précédente avec la fonction } } diff --git a/cryptide_project/src/Pages/InGame.tsx b/cryptide_project/src/Pages/InGame.tsx index 0c533e9..cc04fe5 100644 --- a/cryptide_project/src/Pages/InGame.tsx +++ b/cryptide_project/src/Pages/InGame.tsx @@ -365,7 +365,8 @@ const InGame = ({locale, changeLocale}) => { putCorrectBackground={putCorrectBackground} putGreyBackground={putGreyBackgroud} putImposssibleGrey={putImposssibleGrey} - handleTurn={handleTurn}/> + handleTurn={handleTurn} + lang={locale}/> {playTurnSound &&