1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 22:44:19 +00:00

🌍 Translated UI

This commit is contained in:
@uni-chiara 2021-05-18 18:50:02 +02:00
parent 79427d6b96
commit cbfb66854e
6 changed files with 41 additions and 18 deletions

View file

@ -22,6 +22,7 @@ export default {
email: "Email", email: "Email",
passwd: "Password", passwd: "Password",
dashboardTitle: "Crea una nuova repository",
dashboard: "Dashboard", dashboard: "Dashboard",
searchBy: "Ricerca per", searchBy: "Ricerca per",
byZone: "area", byZone: "area",
@ -42,6 +43,7 @@ export default {
repositories: "Repositories", repositories: "Repositories",
repoMenu: "Menu repository", repoMenu: "Menu repository",
repoEdit: "Modifica repository",
menuActive: "Le tue repository attive", menuActive: "Le tue repository attive",
menuArchived: "Le tue repository archiviate", menuArchived: "Le tue repository archiviate",
emptyMenu: "Non c'è nulla qui", emptyMenu: "Non c'è nulla qui",
@ -54,6 +56,7 @@ export default {
alerts: "Allarmi", alerts: "Allarmi",
alertTitle: "I tuoi allarmi", alertTitle: "I tuoi allarmi",
alertCreate: "Crea un allarme", alertCreate: "Crea un allarme",
notImplemented: "🚧 Non implementato.",
settings: "Impostazioni", settings: "Impostazioni",
loggedInTitle: "Accesso effettuato", loggedInTitle: "Accesso effettuato",
@ -63,6 +66,7 @@ export default {
switchTheme: "Cambia tema", switchTheme: "Cambia tema",
darkMode: "Scuro", darkMode: "Scuro",
lightMode: "Chiaro", lightMode: "Chiaro",
changeLang: "Cambia lingua",
alertSettings: "Impostazioni allarmi", alertSettings: "Impostazioni allarmi",
changeEmail: "Cambia il tuo indirizzo email", changeEmail: "Cambia il tuo indirizzo email",
changePasswd: "Cambia la tua password", changePasswd: "Cambia la tua password",
@ -89,6 +93,7 @@ export default {
email: "Email", email: "Email",
passwd: "Password", passwd: "Password",
dashboardTitle: "Create a new repository",
dashboard: "Dashboard", dashboard: "Dashboard",
searchBy: "Search by", searchBy: "Search by",
byZone: "zone", byZone: "zone",
@ -109,6 +114,7 @@ export default {
repositories: "Repositories", repositories: "Repositories",
repoMenu: "Repositories menu", repoMenu: "Repositories menu",
repoEdit: "Edit repository",
menuActive: "Your active repositories", menuActive: "Your active repositories",
menuArchived: "Your archived repositories", menuArchived: "Your archived repositories",
emptyMenu: "There's nothing here", emptyMenu: "There's nothing here",
@ -121,6 +127,7 @@ export default {
alerts: "Alerts", alerts: "Alerts",
alertTitle: "Your alerts", alertTitle: "Your alerts",
alertCreate: "Create a new alert", alertCreate: "Create a new alert",
notImplemented: "🚧 Not implemented.",
settings: "Settings", settings: "Settings",
loggedInTitle: "Logged in", loggedInTitle: "Logged in",
@ -130,6 +137,7 @@ export default {
switchTheme: "Switch theme", switchTheme: "Switch theme",
darkMode: "Dark", darkMode: "Dark",
lightMode: "Light", lightMode: "Light",
changeLang: "Change language",
alertSettings: "Alert settings", alertSettings: "Alert settings",
changeEmail: "Change your email address", changeEmail: "Change your email address",
changePasswd: "Change your password", changePasswd: "Change your password",
@ -156,6 +164,7 @@ export default {
email: "Sähköposti", email: "Sähköposti",
passwd: "Salasana", passwd: "Salasana",
dashboardTitle: "Luo uusi arkisto",
dashboard: "Kojelauta", dashboard: "Kojelauta",
searchBy: "Haku ", searchBy: "Haku ",
byZone: "vyöhykkeen mukaan", byZone: "vyöhykkeen mukaan",
@ -176,6 +185,7 @@ export default {
repositories: "Arkistot", repositories: "Arkistot",
repoMenu: "Arkistot-valikko", repoMenu: "Arkistot-valikko",
repoEdit: "Muokkaa arkistoa",
menuActive: "Aktiiviset arkistosi", menuActive: "Aktiiviset arkistosi",
menuArchived: "Arkistoidut arkistosi", menuArchived: "Arkistoidut arkistosi",
emptyMenu: "Täällä ei ole mitään", emptyMenu: "Täällä ei ole mitään",
@ -188,6 +198,7 @@ export default {
alerts: "Hälytykset", alerts: "Hälytykset",
alertTitle: "Hälytyksesi", alertTitle: "Hälytyksesi",
alertCreate: "Luo uusi hälytys", alertCreate: "Luo uusi hälytys",
notImplemented: "🚧 Ei toteutettu.",
settings: "Asetukset", settings: "Asetukset",
loggedInTitle: "Kirjautunut sisään", loggedInTitle: "Kirjautunut sisään",
@ -197,6 +208,7 @@ export default {
switchTheme: "Vaihda teema", switchTheme: "Vaihda teema",
darkMode: "Tumma", darkMode: "Tumma",
lightMode: "Selkeä", lightMode: "Selkeä",
changeLang: "Vaihda kieltä",
alertSettings: "Hälytysasetukset", alertSettings: "Hälytysasetukset",
changeEmail: "Vaihda sähköpostiosoitteesi", changeEmail: "Vaihda sähköpostiosoitteesi",
changePasswd: "Vaihda salasanasi", changePasswd: "Vaihda salasanasi",

View file

@ -10,11 +10,11 @@ export default function PageAlerts({ children, className, ...props }) {
return ( return (
<div className={classNames(Style.PageAlerts, className)} {...props}> <div className={classNames(Style.PageAlerts, className)} {...props}>
<BoxFull header={"I tuoi allarmi"} className={Style.YourAlerts}> <BoxFull header={strings.alertTitle} className={Style.YourAlerts}>
🚧 Non implementato. {strings.notImplemented}
</BoxFull> </BoxFull>
<BoxFull header={"Crea un nuovo allarme"} className={Style.CreateAlert}> <BoxFull header={strings.alertCreate} className={Style.CreateAlert}>
🚧 Non implementato. {strings.notImplemented}
</BoxFull> </BoxFull>
</div> </div>
) )

View file

@ -1,15 +1,18 @@
import React from "react" import React, {useContext} from "react"
import Style from "./PageDashboard.module.css" import Style from "./PageDashboard.module.css"
import classNames from "classnames" import classNames from "classnames"
import BoxHeader from "../components/base/BoxHeader" import BoxHeader from "../components/base/BoxHeader"
import RepositoryEditor from "../components/providers/RepositoryEditor" import RepositoryEditor from "../components/providers/RepositoryEditor"
import ContextLanguage from "../contexts/ContextLanguage"
export default function PageDashboard({ children, className, ...props }) { export default function PageDashboard({ children, className, ...props }) {
const { strings } = useContext(ContextLanguage)
return ( return (
<div className={classNames(Style.PageHome, className)} {...props}> <div className={classNames(Style.PageHome, className)} {...props}>
<BoxHeader className={Style.Header}> <BoxHeader className={Style.Header}>
Crea una nuova repository {strings.dashboardTitle}
</BoxHeader> </BoxHeader>
<RepositoryEditor className={Style.RepositoryEditor}/> <RepositoryEditor className={Style.RepositoryEditor}/>
</div> </div>

View file

@ -7,9 +7,12 @@ import useBackendImmediately from "../hooks/useBackendImmediately"
import ContextUser from "../contexts/ContextUser" import ContextUser from "../contexts/ContextUser"
import renderContents from "../utils/renderContents" import renderContents from "../utils/renderContents"
import { useParams } from "react-router" import { useParams } from "react-router"
import ContextLanguage from "../contexts/ContextLanguage"
export default function PageEdit({ className, ...props }) { export default function PageEdit({ className, ...props }) {
const { strings } = useContext(ContextLanguage)
const { id } = useParams() const { id } = useParams()
const { fetchDataAuth } = useContext(ContextUser) const { fetchDataAuth } = useContext(ContextUser)
const repositoryRequest = useBackendImmediately(fetchDataAuth, "GET", `/api/v1/repositories/${id}`) const repositoryRequest = useBackendImmediately(fetchDataAuth, "GET", `/api/v1/repositories/${id}`)
@ -24,7 +27,7 @@ export default function PageEdit({ className, ...props }) {
return ( return (
<div className={classNames(Style.PageHome, className)} {...props}> <div className={classNames(Style.PageHome, className)} {...props}>
<BoxHeader className={Style.Header}> <BoxHeader className={Style.Header}>
Modifica repository {strings.repoEdit}
</BoxHeader> </BoxHeader>
{contents} {contents}
</div> </div>

View file

@ -1,4 +1,4 @@
import React from "react" import React, { useContext } from "react"
import Style from "./PageSettings.module.css" import Style from "./PageSettings.module.css"
import classNames from "classnames" import classNames from "classnames"
import BoxHeader from "../components/base/BoxHeader" import BoxHeader from "../components/base/BoxHeader"
@ -6,27 +6,29 @@ import BoxFull from "../components/base/BoxFull"
import SelectTheme from "../components/interactive/SelectTheme" import SelectTheme from "../components/interactive/SelectTheme"
import BoxLoggedIn from "../components/interactive/BoxLoggedIn" import BoxLoggedIn from "../components/interactive/BoxLoggedIn"
import SelectLanguage from "../components/interactive/SelectLanguage" import SelectLanguage from "../components/interactive/SelectLanguage"
import ContextLanguage from "../contexts/ContextLanguage"
export default function PageSettings({ children, className, ...props }) { export default function PageSettings({ children, className, ...props }) {
const { strings } = useContext(ContextLanguage)
return ( return (
<div className={classNames(Style.PageSettings, className)} {...props}> <div className={classNames(Style.PageSettings, className)} {...props}>
<BoxLoggedIn/> <BoxLoggedIn/>
<BoxHeader> <BoxHeader>
Cambia tema: <SelectTheme/> {strings.switchTheme}: <SelectTheme/>
</BoxHeader> </BoxHeader>
<BoxHeader> <BoxHeader>
Cambia lingua: <SelectLanguage/> {strings.changeLang}: <SelectLanguage/>
</BoxHeader> </BoxHeader>
<BoxFull header={"Impostazioni allarmi"}> <BoxFull header={strings.alertSettings}>
🚧 Non implementato. {strings.notImplemented}
</BoxFull> </BoxFull>
<BoxFull header={"Cambia il tuo indirizzo email"}> <BoxFull header={strings.changeEmail}>
🚧 Non implementato. {strings.notImplemented}
</BoxFull> </BoxFull>
<BoxFull header={"Cambia la tua password"}> <BoxFull header={strings.changePasswd}>
🚧 Non implementato. {strings.notImplemented}
</BoxFull> </BoxFull>
</div> </div>
) )

View file

@ -1,19 +1,22 @@
import React from "react" import React, { useContext } from "react"
import Style from "./PageUsers.module.css" import Style from "./PageUsers.module.css"
import classNames from "classnames" import classNames from "classnames"
import BoxHeader from "../components/base/BoxHeader" import BoxHeader from "../components/base/BoxHeader"
import BoxUserCreate from "../components/interactive/BoxUserCreate" import BoxUserCreate from "../components/interactive/BoxUserCreate"
import useBackendViewset from "../hooks/useBackendViewset" import useBackendViewset from "../hooks/useBackendViewset"
import BoxUserList from "../components/interactive/BoxUserList" import BoxUserList from "../components/interactive/BoxUserList"
import ContextLanguage from "../contexts/ContextLanguage"
export default function PageUsers({ children, className, ...props }) { export default function PageUsers({ children, className, ...props }) {
const { strings } = useContext(ContextLanguage)
const bv = useBackendViewset("/api/v1/users/", "email") const bv = useBackendViewset("/api/v1/users/", "email")
return ( return (
<div className={classNames(Style.PageUsers, className)} {...props}> <div className={classNames(Style.PageUsers, className)} {...props}>
<BoxHeader className={Style.Header}> <BoxHeader className={Style.Header}>
Gestisci utenti {strings.manageUsers}
</BoxHeader> </BoxHeader>
<BoxUserCreate className={Style.CreateUser} createUser={bv.createResource} running={bv.running}/> <BoxUserCreate className={Style.CreateUser} createUser={bv.createResource} running={bv.running}/>
<BoxUserList className={Style.UserList} users={bv.resources} destroyUser={bv.destroyResource} running={bv.running}/> <BoxUserList className={Style.UserList} users={bv.resources} destroyUser={bv.destroyResource} running={bv.running}/>