diff --git a/FrontendV2/src/components/Header.tsx b/FrontendV2/src/components/Header.tsx index bc3f8ee..732e4f4 100644 --- a/FrontendV2/src/components/Header.tsx +++ b/FrontendV2/src/components/Header.tsx @@ -30,6 +30,8 @@ import { import { useUserContext } from "@/states/Context"; import { useState } from "react"; import MyAlert from "./myChakra/MyAlert"; +import { useTranslation } from "react-i18next"; +import { Trans } from "react-i18next"; const API_BASE = (import.meta as any).env?.VITE_BACKEND_URL || @@ -39,6 +41,7 @@ const API_BASE = export const Header = () => { const navigate = useNavigate(); const userData = useUserContext(); + const { t } = useTranslation(); // Error handling states const [isMsg, setIsMsg] = useState(false); @@ -232,7 +235,8 @@ export const Header = () => { - Willkommen zurück, {username}! + {t("greeting")} + {username}! Rolle: {userData?.role ?? "—"} diff --git a/FrontendV2/src/utils/i18n/locales/de/de.json b/FrontendV2/src/utils/i18n/locales/de/de.json new file mode 100644 index 0000000..f33897f --- /dev/null +++ b/FrontendV2/src/utils/i18n/locales/de/de.json @@ -0,0 +1,3 @@ +{ + "greeting": "Willkommen zurück, " +} \ No newline at end of file diff --git a/FrontendV2/src/utils/i18n/locales/en/en.json b/FrontendV2/src/utils/i18n/locales/en/en.json new file mode 100644 index 0000000..f8434f9 --- /dev/null +++ b/FrontendV2/src/utils/i18n/locales/en/en.json @@ -0,0 +1,3 @@ +{ + "greeting": "Welcome back, " +} \ No newline at end of file