From 5a035e63709a5c82a87dd553f225f67fcf90018b Mon Sep 17 00:00:00 2001 From: Namonay Date: Mon, 6 May 2024 18:09:48 +0200 Subject: [PATCH] fix: matchmaking: undefinned in gamemode choice field --- frontend/static/js/api/game/tictactoe/TicTacToeGame.js | 5 +++-- frontend/static/js/lang/cr.json | 1 + frontend/static/js/lang/en.json | 1 + frontend/static/js/lang/fr.json | 1 + frontend/static/js/lang/tp.json | 1 + frontend/static/js/views/MatchMakingView.js | 2 +- 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/static/js/api/game/tictactoe/TicTacToeGame.js b/frontend/static/js/api/game/tictactoe/TicTacToeGame.js index ffbaad5..9312e22 100644 --- a/frontend/static/js/api/game/tictactoe/TicTacToeGame.js +++ b/frontend/static/js/api/game/tictactoe/TicTacToeGame.js @@ -1,4 +1,5 @@ -import { client } from "../../../index.js"; +import { client, lang } from "../../../index.js"; + import { AGame } from "../AGame.js"; class TicTacToe @@ -87,7 +88,7 @@ class TicTacToe this.context.closePath(); this.context.beginPath(); this.context.fillStyle = (winning_sign == "o") ? "red" : "green"; - this.context.fillText((winning_sign == "o") ? "Winner is : O" : "Winner is : X", this.width / 2 - 30, this.height - this.gap / 2, 140); + this.context.fillText((winning_sign == "o") ? lang.get("morpionWin") + "O" : lang.get("morpionWin") + "X", this.width / 2 - 30, this.height - this.gap / 2, 140); this.context.closePath(); } checkWin() diff --git a/frontend/static/js/lang/cr.json b/frontend/static/js/lang/cr.json index 495e4d5..31152ec 100644 --- a/frontend/static/js/lang/cr.json +++ b/frontend/static/js/lang/cr.json @@ -46,6 +46,7 @@ "ruleBase" : "cramptun. Vous devez quouicougagner sur une des 9 quoicougrilles pour gagner la croustipartie", "ruleMovement" : "quoicoudeux. Vous quoicommencez sur le morpion quoicoucentral, et jouez sur le quoicoumorpion correspondant a votre croustichoix a votre prochain cramptour", "ruleDraw" : "cramptrois. Si votre quoicouchoix rempli entièrement un quoicoumorpion et provoque une cramptégalité, vous perdez", + "morpionWin" : "Le quoicougagnant est :", "matchmakingTitle": "Matchmaking crampté", "matchmakingStartSearch": "Cramptrouver une partie", "matchmakingStopSearch": "Crampter le matchmaking", diff --git a/frontend/static/js/lang/en.json b/frontend/static/js/lang/en.json index fe85e56..fe667e2 100644 --- a/frontend/static/js/lang/en.json +++ b/frontend/static/js/lang/en.json @@ -45,6 +45,7 @@ "ruleBase" : "1. Win on one of the 9 tictactoe to win the game", "ruleMovement" : "2. You start on the central tictactoe, and play on the one corresponding to your choice on the next turn", "ruleDraw" : "3. If your play cause a tictactoe to be full and a draw, you lose the game", + "morpionWin" : "The winner is :", "matchmakingTitle": "Matchmaking", "matchmakingStartSearch": "Find a game", "matchmakingStopSearch": "Stop matchmaking", diff --git a/frontend/static/js/lang/fr.json b/frontend/static/js/lang/fr.json index 6ae262d..623bbd2 100644 --- a/frontend/static/js/lang/fr.json +++ b/frontend/static/js/lang/fr.json @@ -45,6 +45,7 @@ "ruleBase" : "1. Vous devez gagner sur une des 9 grilles pour gagner la partie", "ruleMovement" : "2. Vous commencez sur le morpion central, et jouez sur le morpion correspondant a votre choix a votre prochain tour", "ruleDraw" : "3. Si votre choix rempli entièrement un morpion et provoque une égalité, vous perdez", + "morpionWin" : "Le gagnant est :", "matchmakingTitle": "Matchmaking", "matchmakingStartSearch": "Trouver une partie", "matchmakingStopSearch": "Arrêter le matchmaking", diff --git a/frontend/static/js/lang/tp.json b/frontend/static/js/lang/tp.json index ca228d2..df0b158 100644 --- a/frontend/static/js/lang/tp.json +++ b/frontend/static/js/lang/tp.json @@ -45,6 +45,7 @@ "ruleBase" : "1. Win on wan pi the 9 tictactoe tawa win the game", "ruleMovement" : "2. Sina open on the central tictactoe, en play on the wan corresponding tawa your choice on the next turn", "ruleDraw" : "3. If your play cause a tictactoe tawa be full en a draw, sina lose the game", + "morpionWin" : "jan li jo e poka sina :", "matchmakingTitle": "Matchmaking", "matchmakingStartSearch": "lukin e ilo musi", "matchmakingStopSearch": "o pini e pana sona e jan pi pana sona e jan ante.", diff --git a/frontend/static/js/views/MatchMakingView.js b/frontend/static/js/views/MatchMakingView.js index b8bce29..1f7e558 100644 --- a/frontend/static/js/views/MatchMakingView.js +++ b/frontend/static/js/views/MatchMakingView.js @@ -122,7 +122,7 @@ export default class extends AbstractAuthenticatedView { - +