translated greeting
This commit is contained in:
@@ -30,6 +30,8 @@ import {
|
|||||||
import { useUserContext } from "@/states/Context";
|
import { useUserContext } from "@/states/Context";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import MyAlert from "./myChakra/MyAlert";
|
import MyAlert from "./myChakra/MyAlert";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { Trans } from "react-i18next";
|
||||||
|
|
||||||
const API_BASE =
|
const API_BASE =
|
||||||
(import.meta as any).env?.VITE_BACKEND_URL ||
|
(import.meta as any).env?.VITE_BACKEND_URL ||
|
||||||
@@ -39,6 +41,7 @@ const API_BASE =
|
|||||||
export const Header = () => {
|
export const Header = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const userData = useUserContext();
|
const userData = useUserContext();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
// Error handling states
|
// Error handling states
|
||||||
const [isMsg, setIsMsg] = useState(false);
|
const [isMsg, setIsMsg] = useState(false);
|
||||||
@@ -232,7 +235,8 @@ export const Header = () => {
|
|||||||
|
|
||||||
<HStack gap={3} align="center" flexWrap="wrap">
|
<HStack gap={3} align="center" flexWrap="wrap">
|
||||||
<Text fontSize="md" className="text-slate-600 dark:text-slate-400">
|
<Text fontSize="md" className="text-slate-600 dark:text-slate-400">
|
||||||
Willkommen zurück, {username}!
|
{t("greeting")}
|
||||||
|
<strong>{username}</strong>!
|
||||||
</Text>
|
</Text>
|
||||||
<Badge variant="subtle" px={2} py={1} borderRadius="full">
|
<Badge variant="subtle" px={2} py={1} borderRadius="full">
|
||||||
Rolle: {userData?.role ?? "—"}
|
Rolle: {userData?.role ?? "—"}
|
||||||
|
|||||||
3
FrontendV2/src/utils/i18n/locales/de/de.json
Normal file
3
FrontendV2/src/utils/i18n/locales/de/de.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"greeting": "Willkommen zurück, "
|
||||||
|
}
|
||||||
3
FrontendV2/src/utils/i18n/locales/en/en.json
Normal file
3
FrontendV2/src/utils/i18n/locales/en/en.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"greeting": "Welcome back, "
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user