From 965a4b97eeeaffb78f26b2f371a181cf4154d428 Mon Sep 17 00:00:00 2001 From: Theis Gaedigk Date: Sun, 26 Oct 2025 12:53:07 +0100 Subject: [PATCH] translated greeting --- FrontendV2/src/components/Header.tsx | 6 +++++- FrontendV2/src/utils/i18n/locales/de/de.json | 3 +++ FrontendV2/src/utils/i18n/locales/en/en.json | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 FrontendV2/src/utils/i18n/locales/de/de.json create mode 100644 FrontendV2/src/utils/i18n/locales/en/en.json 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