diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 20e1596..7b0eaec 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -16,7 +16,8 @@ import { useEffect, useState } from "react"; import close from "../public/close.svg"; import menu from "../public/menu.svg"; import sato_logo_nav from "../public/sato_logo_nav.png"; -import { useLanguage } from "@/lib/LocalizationContext"; +import { useLanguage } from "@/lib/LanguageContext"; +import useTranslate from "@/hooks/useTranslate"; type Anchor = "right"; @@ -25,6 +26,7 @@ interface NavbarProps { } const Navbar = ({ navData }: NavbarProps) => { + const t = useTranslate(); const [state, setState] = useState({ right: false, }); @@ -33,8 +35,6 @@ const Navbar = ({ navData }: NavbarProps) => { const currentRoute = router.pathname; const navGeneral = cmsData.data.slice(0, 4); const navForMembers = cmsData.data.slice(4); - const forMembersLabel = cmsData.data.slice(11, 12)[0]; - const languagesLabel = cmsData.data.slice(12, 13)[0]; const { language, setLanguage } = useLanguage(); useEffect(() => { @@ -112,8 +112,7 @@ const Navbar = ({ navData }: NavbarProps) => {
- {/* @ts-ignore: Dynamic property access */} - {forMembersLabel[`text_${language}`]} + {t("nav:forMembers")} {navForMembers.map((data: any) => ( @@ -137,8 +136,7 @@ const Navbar = ({ navData }: NavbarProps) => {
- {/* @ts-ignore: Dynamic property access */} - {languagesLabel[`text_${language}`]} + {t("nav:languages")}