From e3dc3dc18b078893903d4f96cc3cdbf4d05238d1 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 17 Apr 2021 20:37:13 +0300 Subject: [PATCH] translations --- public/locales/en/translations.json | 9 +++++++++ public/locales/ro/translations.json | 9 +++++++++ src/features/machines/components/Machine.js | 4 +--- src/features/machines/components/MachineContainer.js | 6 ++++-- src/features/machines/components/MachinesList.js | 10 ++++++---- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/public/locales/en/translations.json b/public/locales/en/translations.json index 91644de..ece7770 100644 --- a/public/locales/en/translations.json +++ b/public/locales/en/translations.json @@ -27,5 +27,14 @@ "IncorrectCredentials": "Incorrect credentials.", "Hello": "Hi, {{username}}", "AuthenticationDate": "Authentication date" + }, + "Machine": { + "FullName": "Full machine name", + "Name": "Machine name", + "IP": "IP", + "Actions": { + "Wake": "Wake", + "Ping": "Ping" + } } } diff --git a/public/locales/ro/translations.json b/public/locales/ro/translations.json index b1753ae..b81e299 100644 --- a/public/locales/ro/translations.json +++ b/public/locales/ro/translations.json @@ -18,5 +18,14 @@ "IncorrectCredentials": "Credențiale incorecte.", "Hello": "Salut, {{username}}", "AuthenticationDate": "Momentul autentificării" + }, + "Machine": { + "FullName": "Nume intreg masina", + "Name": "Nume masina", + "IP": "IP", + "Actions": { + "Wake": "Pornește", + "Ping": "Ping" + } } } diff --git a/src/features/machines/components/Machine.js b/src/features/machines/components/Machine.js index eec9bca..e1cfff2 100644 --- a/src/features/machines/components/Machine.js +++ b/src/features/machines/components/Machine.js @@ -10,7 +10,6 @@ import { import { KeyboardArrowDown, KeyboardArrowUp } from "@material-ui/icons"; import { makeStyles } from "@material-ui/core/styles"; import MachineLog from "./MachineLog"; -import { useTranslation } from "react-i18next"; const useRowStyles = makeStyles({ root: { @@ -23,7 +22,6 @@ const useRowStyles = makeStyles({ const Machine = ({ machine, actions, logs }) => { const [open, setOpen] = React.useState(false); const classes = useRowStyles(); - const { t } = useTranslation(); return ( @@ -46,7 +44,7 @@ const Machine = ({ machine, actions, logs }) => { <> {actions.map(action => ( diff --git a/src/features/machines/components/MachineContainer.js b/src/features/machines/components/MachineContainer.js index 5ee7230..54e1ff0 100644 --- a/src/features/machines/components/MachineContainer.js +++ b/src/features/machines/components/MachineContainer.js @@ -4,10 +4,12 @@ import Machine from "./Machine"; import * as api from "../api"; import { useToast } from "../../../hooks"; import { PowerSettingsNew, LastPage } from "@material-ui/icons"; +import { useTranslation } from "react-i18next"; const MachineContainer = ({ machine }) => { const [logs, setLogs] = useState([]); const { success, error } = useToast(); + const { t } = useTranslation(); const addLog = text => { setLogs(prev => [...prev, text]); @@ -40,13 +42,13 @@ const MachineContainer = ({ machine }) => { code: "wake", effect: wakeMachine, icon: PowerSettingsNew, - tooltip: "Wake" + tooltip: t("Machine.Actions.Wake") }, { code: "ping", effect: pingMachine, icon: LastPage, - tooltip: "Ping" + tooltip: t("Machine.Actions.Ping") } ]; diff --git a/src/features/machines/components/MachinesList.js b/src/features/machines/components/MachinesList.js index 20c6ebc..1d5b608 100644 --- a/src/features/machines/components/MachinesList.js +++ b/src/features/machines/components/MachinesList.js @@ -10,17 +10,19 @@ import { } from "@material-ui/core"; import Paper from "@material-ui/core/Paper"; import MachineContainer from "./MachineContainer"; +import { useTranslation } from "react-i18next"; -const MachinesList = ({ dense, machines, actions }) => { +const MachinesList = ({ dense, machines }) => { + const { t } = useTranslation(); return ( - Full machine name - Machine name - IP + {t("Machine.FullName")} + {t("Machine.Name")} + {t("Machine.IP")}