fix some styling, add languages
This commit is contained in:
parent
ca85fc17e5
commit
80f1f5e81c
|
@ -1,135 +1,47 @@
|
|||
{
|
||||
"Information": {
|
||||
"defaultMessage": "Information"
|
||||
},
|
||||
"addNewChild": {
|
||||
"defaultMessage": "Add new child"
|
||||
},
|
||||
"addNewDialogButton": {
|
||||
"defaultMessage": "Add new dialog button"
|
||||
},
|
||||
"addUser": {
|
||||
"defaultMessage": "Create user"
|
||||
},
|
||||
"alarms": {
|
||||
"defaultMessage": "Alarms"
|
||||
},
|
||||
"applyChanges": {
|
||||
"defaultMessage": "Apply changes"
|
||||
},
|
||||
"country": {
|
||||
"defaultMessage": "Country"
|
||||
},
|
||||
"createNewFolder": {
|
||||
"defaultMessage": "Create new folder"
|
||||
},
|
||||
"createNewUser": {
|
||||
"defaultMessage": "Create new user"
|
||||
},
|
||||
"customerName": {
|
||||
"defaultMessage": "Customer"
|
||||
},
|
||||
"email": {
|
||||
"defaultMessage": "Email"
|
||||
},
|
||||
"english": {
|
||||
"defaultMessage": "English"
|
||||
},
|
||||
"Information": "Information",
|
||||
"addNewChild": "Add new child",
|
||||
"addNewDialogButton": "Add new dialog button",
|
||||
"addUser": "Create user",
|
||||
"alarms": "Alarms",
|
||||
"applyChanges": "Apply changes",
|
||||
"country": "Country",
|
||||
"createNewFolder": "Create new folder",
|
||||
"createNewUser": "Create new user",
|
||||
"customerName": "Customer",
|
||||
"email": "Email",
|
||||
"english": "English",
|
||||
"error": {},
|
||||
"folder": {
|
||||
"defaultMessage": "Folder"
|
||||
},
|
||||
"german": {
|
||||
"defaultMessage": "German"
|
||||
},
|
||||
"groupTabs": {
|
||||
"defaultMessage": "Group tabs"
|
||||
},
|
||||
"groupTree": {
|
||||
"defaultMessage": "Group tree"
|
||||
},
|
||||
"information": {
|
||||
"defaultMessage": "Information"
|
||||
},
|
||||
"inheritedAccess": {
|
||||
"defaultMessage": "Inherited access from"
|
||||
},
|
||||
"installation": {
|
||||
"defaultMessage": "Installation"
|
||||
},
|
||||
"installationTabs": {
|
||||
"defaultMessage": "Installation tabs"
|
||||
},
|
||||
"installations": {
|
||||
"defaultMessage": "Installations"
|
||||
},
|
||||
"lastWeek": {
|
||||
"defaultMessage": "Last week"
|
||||
},
|
||||
"location": {
|
||||
"defaultMessage": "Location"
|
||||
},
|
||||
"log": {
|
||||
"defaultMessage": "Log"
|
||||
},
|
||||
"logout": {
|
||||
"defaultMessage": "Logout"
|
||||
},
|
||||
"makeASelection": {
|
||||
"defaultMessage": "Please make a selection on the left"
|
||||
},
|
||||
"manageAccess": {
|
||||
"defaultMessage": "Manage access"
|
||||
},
|
||||
"move": {
|
||||
"defaultMessage": "Move"
|
||||
},
|
||||
"moveTo": {
|
||||
"defaultMessage": "Move to"
|
||||
},
|
||||
"moveTree": {
|
||||
"defaultMessage": "Move tree"
|
||||
},
|
||||
"name": {
|
||||
"defaultMessage": "Name"
|
||||
},
|
||||
"navigationTabs": {
|
||||
"defaultMessage": "Navigation tabs"
|
||||
},
|
||||
"orderNumbers": {
|
||||
"defaultMessage": "Order number"
|
||||
},
|
||||
"region": {
|
||||
"defaultMessage": "Region"
|
||||
},
|
||||
"requiredLocation": {
|
||||
"defaultMessage": "Location is required"
|
||||
},
|
||||
"requiredName": {
|
||||
"defaultMessage": "Name is required"
|
||||
},
|
||||
"requiredRegion": {
|
||||
"defaultMessage": "Region is required"
|
||||
},
|
||||
"search": {
|
||||
"defaultMessage": "Search"
|
||||
},
|
||||
"submit": {
|
||||
"defaultMessage": "Submit"
|
||||
},
|
||||
"updateFolderErrorMessage": {
|
||||
"defaultMessage": "Couldn't update folder, an error occured"
|
||||
},
|
||||
"updatedSuccessfully": {
|
||||
"defaultMessage": "Updated successfully"
|
||||
},
|
||||
"user": {
|
||||
"defaultMessage": "User"
|
||||
},
|
||||
"userTabs": {
|
||||
"defaultMessage": "user tabs"
|
||||
},
|
||||
"users": {
|
||||
"defaultMessage": "Users"
|
||||
}
|
||||
"folder": "Folder",
|
||||
"german": "German",
|
||||
"groupTabs": "Group tabs",
|
||||
"groupTree": "Group tree",
|
||||
"information": "Information",
|
||||
"inheritedAccess": "Inherited access from",
|
||||
"installation": "Installation",
|
||||
"installationTabs": "Installation tabs",
|
||||
"installations": "Installations",
|
||||
"lastWeek": "Last week",
|
||||
"location": "Location",
|
||||
"log": "Log",
|
||||
"logout": "Logout",
|
||||
"makeASelection": "Please make a selection on the left",
|
||||
"manageAccess": "Manage access",
|
||||
"move": "Move",
|
||||
"moveTo": "Move to",
|
||||
"moveTree": "Move tree",
|
||||
"name": "Name",
|
||||
"navigationTabs": "Navigation tabs",
|
||||
"orderNumbers": "Order number",
|
||||
"region": "Region",
|
||||
"requiredLocation": "Location is required",
|
||||
"requiredName": "Name is required",
|
||||
"requiredRegion": "Region is required",
|
||||
"search": "Search",
|
||||
"submit": "Submit",
|
||||
"updateFolderErrorMessage": "Couldn't update folder, an error occured",
|
||||
"updatedSuccessfully": "Updated successfully",
|
||||
"user": "User",
|
||||
"userTabs": "user tabs",
|
||||
"users": "Users"
|
||||
}
|
||||
|
|
|
@ -4,10 +4,11 @@ import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";
|
|||
|
||||
import { Container, Grid, colors } from "@mui/material";
|
||||
import routes from "./routes.json";
|
||||
import { IntlProvider } from "react-intl";
|
||||
import { IntlProvider, MessageFormatElement } from "react-intl";
|
||||
import { useContext, useState } from "react";
|
||||
import en from "./lang/en.json";
|
||||
import de from "./lang/de.json";
|
||||
import fr from "./lang/fr.json";
|
||||
import LanguageSelect from "./components/Layout/LanguageSelect";
|
||||
import LogoutButton from "./components/Layout/LogoutButton";
|
||||
import Users from "./components/Users/Users";
|
||||
|
@ -16,7 +17,6 @@ import InstallationPage from "./components/Installations/InstallationPage";
|
|||
import { UserContext } from "./components/Context/UserContextProvider";
|
||||
import ResetPassword from "./ResetPassword";
|
||||
import innovenergyLogo from "./resources/test.gif";
|
||||
import { Background } from "reactflow";
|
||||
|
||||
const App = () => {
|
||||
const { token, setToken, removeToken } = useToken();
|
||||
|
@ -25,10 +25,14 @@ const App = () => {
|
|||
const { getCurrentUser } = useContext(UserContext);
|
||||
|
||||
const getTranslations = () => {
|
||||
if (language === "DE") {
|
||||
switch (language) {
|
||||
case "DE":
|
||||
return de;
|
||||
}
|
||||
case "EN":
|
||||
return en;
|
||||
case "FR":
|
||||
return fr;
|
||||
}
|
||||
};
|
||||
|
||||
if (!token) {
|
||||
|
|
|
@ -30,7 +30,7 @@ const InnovenergyTabs = (props: AntTabsProps) => {
|
|||
"& .MuiTabs-indicator": {
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
backgroundColor: "red",
|
||||
backgroundColor: "inherit",
|
||||
},
|
||||
"&.MuiTabs-root": {
|
||||
width: "100%",
|
||||
|
|
|
@ -5,6 +5,7 @@ interface LanguageSelectProps {
|
|||
language: string;
|
||||
setLanguage: (language: string) => void;
|
||||
}
|
||||
|
||||
const LanguageSelect = (props: LanguageSelectProps) => {
|
||||
return (
|
||||
<Select
|
||||
|
@ -20,6 +21,9 @@ const LanguageSelect = (props: LanguageSelectProps) => {
|
|||
<MenuItem id="german-menu-item" value="DE">
|
||||
<FormattedMessage id="german" defaultMessage="German" />
|
||||
</MenuItem>
|
||||
<MenuItem id="german-menu-item" value="FR">
|
||||
<FormattedMessage id="french" defaultMessage="French" />
|
||||
</MenuItem>
|
||||
</Select>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -5,7 +5,6 @@ import App from "./App";
|
|||
import reportWebVitals from "./reportWebVitals";
|
||||
import {createTheme, ThemeProvider} from "@mui/material";
|
||||
import UserContextProvider from "./components/Context/UserContextProvider";
|
||||
import { orange } from "@mui/material/colors";
|
||||
|
||||
const root = ReactDOM.createRoot(
|
||||
document.getElementById("root") as HTMLElement
|
||||
|
|
|
@ -1,22 +1,47 @@
|
|||
{
|
||||
"liveView": "Live Ansicht",
|
||||
"allInstallations": "Alle Installationen",
|
||||
"applyChanges": "Änderungen übernehmen",
|
||||
"information": "Information",
|
||||
"addNewChild": "Neues Kind hinzufügen",
|
||||
"addNewDialogButton": "Neue Dialogschaltfläche hinzufügen",
|
||||
"addUser": "Nutzer erstellen",
|
||||
"alarms": "Alarme",
|
||||
"applyChanges": "Änderungen speichern",
|
||||
"country": "Land",
|
||||
"createNewFolder": "Neuen Ordner erstellen",
|
||||
"createNewUser": "Neuen Nutzer erstellen",
|
||||
"customerName": "Kundenname",
|
||||
"email": "Email",
|
||||
"english": "Englisch",
|
||||
"german": "Deutsch",
|
||||
"installation": "Installation",
|
||||
"location": "Ort",
|
||||
"log": "Log",
|
||||
"orderNumbers": "Bestellnummern",
|
||||
"region": "Region",
|
||||
"search": "Suche",
|
||||
"users": "Benutzer",
|
||||
"logout": "Logout",
|
||||
"updatedSuccessfully": "Erfolgreich aktualisiert",
|
||||
"groups": "Gruppen",
|
||||
"group": "Gruppe",
|
||||
"error": "Fehler",
|
||||
"folder": "Ordner",
|
||||
"updateFolderErrorMessage": "Der Ordner konnte nicht aktualisiert werden, ein Fehler ist aufgetreten"
|
||||
"german": "Deutsch",
|
||||
"groupTabs": "Gruppen",
|
||||
"groupTree": "Gruppenbaum",
|
||||
"information": "Information",
|
||||
"inheritedAccess": "Vererbter Zugriff von",
|
||||
"installation": "Installation",
|
||||
"installationTabs": "Installationen",
|
||||
"installations": "Installationen",
|
||||
"lastWeek": "Letzte Woche",
|
||||
"location": "Standort",
|
||||
"log": "Logbuch",
|
||||
"logout": "Abmelden",
|
||||
"makeASelection": "Bitte wählen Sie links eine Auswahl",
|
||||
"manageAccess": "Zugriff verwalten",
|
||||
"move": "Verschieben",
|
||||
"moveTo": "Verschieben zu",
|
||||
"moveTree": "Baum verschieben",
|
||||
"name": "Name",
|
||||
"navigationTabs": "Navigation",
|
||||
"orderNumbers": "Bestellnummer",
|
||||
"region": "Region",
|
||||
"requiredLocation": "Standort ist erforderlich",
|
||||
"requiredName": "Name ist erforderlich",
|
||||
"requiredRegion": "Region ist erforderlich",
|
||||
"search": "Suche",
|
||||
"submit": "Senden",
|
||||
"updateFolderErrorMessage": "Fehler, Ordner kann nicht aktualisiert werden",
|
||||
"updatedSuccessfully": "Erfolgreich aktualisiert",
|
||||
"user": "Nutzer",
|
||||
"userTabs": "Nutzer",
|
||||
"users": "Nutzer"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"information": "Informations",
|
||||
"addNewChild": "Ajouter un nouvel enfant",
|
||||
"addNewDialogButton": "Ajouter un nouveau bouton de dialogue",
|
||||
"addUser": "Créer un utilisateur",
|
||||
"alarms": "Alarmes",
|
||||
"applyChanges": "Appliquer les modifications",
|
||||
"country": "Pays",
|
||||
"createNewFolder": "Créer un nouveau dossier",
|
||||
"createNewUser": "Créer un nouvel utilisateur",
|
||||
"customerName": "Nom du client",
|
||||
"email": "E-mail",
|
||||
"english": "Anglais",
|
||||
"error": "Erreur",
|
||||
"folder": "Dossier",
|
||||
"german": "Allemand",
|
||||
"groupTabs": "Onglets de groupe",
|
||||
"groupTree": "Arbre de groupe",
|
||||
"information": "Informations",
|
||||
"inheritedAccess": "Accès hérité de",
|
||||
"installation": "Installation",
|
||||
"installationTabs": "Onglets d'installation",
|
||||
"installations": "Installations",
|
||||
"lastWeek": "La semaine dernière",
|
||||
"location": "Localisation",
|
||||
"log": "Journal",
|
||||
"logout": "Déconnexion",
|
||||
"makeASelection": "Veuillez faire une sélection à gauche",
|
||||
"manageAccess": "Gérer l'accès",
|
||||
"move": "Déplacer",
|
||||
"moveTo": "Déplacer à",
|
||||
"moveTree": "Déplacer l'arbre",
|
||||
"name": "Nom",
|
||||
"navigationTabs": "Onglets de navigation",
|
||||
"orderNumbers": "Numéro de commande",
|
||||
"region": "Région",
|
||||
"requiredLocation": "L'emplacement est requis",
|
||||
"requiredName": "Le nom est obligatoire",
|
||||
"requiredRegion": "La région est obligatoire",
|
||||
"search": "Recherche",
|
||||
"submit": "Soumettre",
|
||||
"updateFolderErrorMessage": "Une erreur s'est produite, impossible de mettre à jour le dossier.",
|
||||
"updatedSuccessfully": "Mise à jour réussie",
|
||||
"user": "Utilisateur",
|
||||
"userTabs": "Onglets utilisateurs",
|
||||
"users": "Utilisateurs"
|
||||
}
|
Loading…
Reference in New Issue