From 53739f15536bab9e7519b9817376bc03e85e3961 Mon Sep 17 00:00:00 2001 From: Jeremie Pardou-Piquemal <571533+jrmi@users.noreply.github.com> Date: Fri, 19 Jun 2020 14:02:21 +0200 Subject: [PATCH] Translate all files --- src/components/GameController.js | 12 +++++++----- src/components/LoadGame.js | 5 ++++- src/i18n/en.json | 8 +++++++- src/i18n/fr.json | 8 +++++++- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/components/GameController.js b/src/components/GameController.js index 9196b7e..695031d 100644 --- a/src/components/GameController.js +++ b/src/components/GameController.js @@ -1,4 +1,5 @@ import React from "react"; +import { useTranslation } from "react-i18next"; import { useC2C } from "../hooks/useC2C"; import { nanoid } from "nanoid"; @@ -33,6 +34,7 @@ export const GameController = ({ boardConfig, setBoardConfig, }) => { + const { t } = useTranslation(); const [c2c, joined, isMaster] = useC2C(); const [downloadURI, setDownloadURI] = React.useState({}); const [date, setDate] = React.useState(Date.now()); @@ -208,16 +210,16 @@ export const GameController = ({ overflowY: "scroll", }} > -

Games

+

{t("Games")}

-

Save/Load

- +

{t("Save/Load")}

+ - Save game + {t("Save game")}
-

Game Box Content

+

{t("Box Content")}

diff --git a/src/components/LoadGame.js b/src/components/LoadGame.js index 9e84dce..35a7360 100644 --- a/src/components/LoadGame.js +++ b/src/components/LoadGame.js @@ -1,7 +1,10 @@ import React from "react"; +import { useTranslation } from "react-i18next"; + import { useDropzone } from "react-dropzone"; const LoadGame = ({ onLoad = () => {} }) => { + const { t } = useTranslation(); const onDrop = React.useCallback( (acceptedFiles) => { acceptedFiles.forEach((file) => { @@ -28,7 +31,7 @@ const LoadGame = ({ onLoad = () => {} }) => { return (
-

Drag 'n' drop some files here, or click to select files

+

{t("Dragn drop file here")}

); }; diff --git a/src/i18n/en.json b/src/i18n/en.json index 83b922b..9caae34 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -1,3 +1,9 @@ { - "Please select or load a game": "Please select or load a game" + "Please select or load a game": "Please select or load a game…", + "Games": "Games", + "Save/Load": "Save/Load", + "Save game": "Save game", + "Box Content": "Box Content", + "Load last game": "Load last game", + "Dragn drop file here": "Drop file here to load them" } diff --git a/src/i18n/fr.json b/src/i18n/fr.json index c24698c..551edfa 100644 --- a/src/i18n/fr.json +++ b/src/i18n/fr.json @@ -1,3 +1,9 @@ { - "Please select or load a game": "Veuillez choisir un jeu" + "Please select or load a game": "Veuillez choisir un jeu…", + "Games": "Jeux", + "Save/Load": "Sauvegardes", + "Save game": "Sauvegarder", + "Box Content": "Boite", + "Load last game": "Dernière partie", + "Dragn drop file here": "Déposez un fichier ici pour charger une partie" }