From cbfb66854e029d8a928b7ab36015e527b1c4e019 Mon Sep 17 00:00:00 2001 From: "@uni-chiara" <258727@studenti.unimore.it> Date: Tue, 18 May 2021 18:50:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=8D=20Translated=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nest_frontend/LocalizationStrings.js | 12 ++++++++++++ nest_frontend/routes/PageAlerts.js | 8 ++++---- nest_frontend/routes/PageDashboard.js | 7 +++++-- nest_frontend/routes/PageEdit.js | 5 ++++- nest_frontend/routes/PageSettings.js | 20 +++++++++++--------- nest_frontend/routes/PageUsers.js | 7 +++++-- 6 files changed, 41 insertions(+), 18 deletions(-) diff --git a/nest_frontend/LocalizationStrings.js b/nest_frontend/LocalizationStrings.js index 4cec0a8..40d9d9e 100644 --- a/nest_frontend/LocalizationStrings.js +++ b/nest_frontend/LocalizationStrings.js @@ -22,6 +22,7 @@ export default { email: "Email", passwd: "Password", + dashboardTitle: "Crea una nuova repository", dashboard: "Dashboard", searchBy: "Ricerca per", byZone: "area", @@ -42,6 +43,7 @@ export default { repositories: "Repositories", repoMenu: "Menu repository", + repoEdit: "Modifica repository", menuActive: "Le tue repository attive", menuArchived: "Le tue repository archiviate", emptyMenu: "Non c'è nulla qui", @@ -54,6 +56,7 @@ export default { alerts: "Allarmi", alertTitle: "I tuoi allarmi", alertCreate: "Crea un allarme", + notImplemented: "🚧 Non implementato.", settings: "Impostazioni", loggedInTitle: "Accesso effettuato", @@ -63,6 +66,7 @@ export default { switchTheme: "Cambia tema", darkMode: "Scuro", lightMode: "Chiaro", + changeLang: "Cambia lingua", alertSettings: "Impostazioni allarmi", changeEmail: "Cambia il tuo indirizzo email", changePasswd: "Cambia la tua password", @@ -89,6 +93,7 @@ export default { email: "Email", passwd: "Password", + dashboardTitle: "Create a new repository", dashboard: "Dashboard", searchBy: "Search by", byZone: "zone", @@ -109,6 +114,7 @@ export default { repositories: "Repositories", repoMenu: "Repositories menu", + repoEdit: "Edit repository", menuActive: "Your active repositories", menuArchived: "Your archived repositories", emptyMenu: "There's nothing here", @@ -121,6 +127,7 @@ export default { alerts: "Alerts", alertTitle: "Your alerts", alertCreate: "Create a new alert", + notImplemented: "🚧 Not implemented.", settings: "Settings", loggedInTitle: "Logged in", @@ -130,6 +137,7 @@ export default { switchTheme: "Switch theme", darkMode: "Dark", lightMode: "Light", + changeLang: "Change language", alertSettings: "Alert settings", changeEmail: "Change your email address", changePasswd: "Change your password", @@ -156,6 +164,7 @@ export default { email: "Sähköposti", passwd: "Salasana", + dashboardTitle: "Luo uusi arkisto", dashboard: "Kojelauta", searchBy: "Haku ", byZone: "vyöhykkeen mukaan", @@ -176,6 +185,7 @@ export default { repositories: "Arkistot", repoMenu: "Arkistot-valikko", + repoEdit: "Muokkaa arkistoa", menuActive: "Aktiiviset arkistosi", menuArchived: "Arkistoidut arkistosi", emptyMenu: "Täällä ei ole mitään", @@ -188,6 +198,7 @@ export default { alerts: "Hälytykset", alertTitle: "Hälytyksesi", alertCreate: "Luo uusi hälytys", + notImplemented: "🚧 Ei toteutettu.", settings: "Asetukset", loggedInTitle: "Kirjautunut sisään", @@ -197,6 +208,7 @@ export default { switchTheme: "Vaihda teema", darkMode: "Tumma", lightMode: "Selkeä", + changeLang: "Vaihda kieltä", alertSettings: "Hälytysasetukset", changeEmail: "Vaihda sähköpostiosoitteesi", changePasswd: "Vaihda salasanasi", diff --git a/nest_frontend/routes/PageAlerts.js b/nest_frontend/routes/PageAlerts.js index 5130fc5..25244a0 100644 --- a/nest_frontend/routes/PageAlerts.js +++ b/nest_frontend/routes/PageAlerts.js @@ -10,11 +10,11 @@ export default function PageAlerts({ children, className, ...props }) { return (
- - 🚧 Non implementato. + + {strings.notImplemented} - - 🚧 Non implementato. + + {strings.notImplemented}
) diff --git a/nest_frontend/routes/PageDashboard.js b/nest_frontend/routes/PageDashboard.js index de51891..5a00b93 100644 --- a/nest_frontend/routes/PageDashboard.js +++ b/nest_frontend/routes/PageDashboard.js @@ -1,15 +1,18 @@ -import React from "react" +import React, {useContext} from "react" import Style from "./PageDashboard.module.css" import classNames from "classnames" import BoxHeader from "../components/base/BoxHeader" import RepositoryEditor from "../components/providers/RepositoryEditor" +import ContextLanguage from "../contexts/ContextLanguage" export default function PageDashboard({ children, className, ...props }) { + const { strings } = useContext(ContextLanguage) + return (
- Crea una nuova repository + {strings.dashboardTitle}
diff --git a/nest_frontend/routes/PageEdit.js b/nest_frontend/routes/PageEdit.js index 4240dd0..18cb2c1 100644 --- a/nest_frontend/routes/PageEdit.js +++ b/nest_frontend/routes/PageEdit.js @@ -7,9 +7,12 @@ import useBackendImmediately from "../hooks/useBackendImmediately" import ContextUser from "../contexts/ContextUser" import renderContents from "../utils/renderContents" import { useParams } from "react-router" +import ContextLanguage from "../contexts/ContextLanguage" export default function PageEdit({ className, ...props }) { + const { strings } = useContext(ContextLanguage) + const { id } = useParams() const { fetchDataAuth } = useContext(ContextUser) const repositoryRequest = useBackendImmediately(fetchDataAuth, "GET", `/api/v1/repositories/${id}`) @@ -24,7 +27,7 @@ export default function PageEdit({ className, ...props }) { return (
- Modifica repository + {strings.repoEdit} {contents}
diff --git a/nest_frontend/routes/PageSettings.js b/nest_frontend/routes/PageSettings.js index 70e98d5..ccd07cb 100644 --- a/nest_frontend/routes/PageSettings.js +++ b/nest_frontend/routes/PageSettings.js @@ -1,4 +1,4 @@ -import React from "react" +import React, { useContext } from "react" import Style from "./PageSettings.module.css" import classNames from "classnames" import BoxHeader from "../components/base/BoxHeader" @@ -6,27 +6,29 @@ import BoxFull from "../components/base/BoxFull" import SelectTheme from "../components/interactive/SelectTheme" import BoxLoggedIn from "../components/interactive/BoxLoggedIn" import SelectLanguage from "../components/interactive/SelectLanguage" +import ContextLanguage from "../contexts/ContextLanguage" export default function PageSettings({ children, className, ...props }) { + const { strings } = useContext(ContextLanguage) return (
- Cambia tema: + {strings.switchTheme}: - Cambia lingua: + {strings.changeLang}: - - 🚧 Non implementato. + + {strings.notImplemented} - - 🚧 Non implementato. + + {strings.notImplemented} - - 🚧 Non implementato. + + {strings.notImplemented}
) diff --git a/nest_frontend/routes/PageUsers.js b/nest_frontend/routes/PageUsers.js index 377d4ec..0b256a8 100644 --- a/nest_frontend/routes/PageUsers.js +++ b/nest_frontend/routes/PageUsers.js @@ -1,19 +1,22 @@ -import React from "react" +import React, { useContext } from "react" import Style from "./PageUsers.module.css" import classNames from "classnames" import BoxHeader from "../components/base/BoxHeader" import BoxUserCreate from "../components/interactive/BoxUserCreate" import useBackendViewset from "../hooks/useBackendViewset" import BoxUserList from "../components/interactive/BoxUserList" +import ContextLanguage from "../contexts/ContextLanguage" export default function PageUsers({ children, className, ...props }) { + const { strings } = useContext(ContextLanguage) + const bv = useBackendViewset("/api/v1/users/", "email") return (
- Gestisci utenti + {strings.manageUsers}