apply translations in all pages

This commit is contained in:
2026-04-17 11:13:20 +02:00
parent dbeb294920
commit 7a8022d11a
15 changed files with 108 additions and 124 deletions
+6 -4
View File
@@ -5,6 +5,7 @@ import React, { useState, useEffect, MouseEvent } from "react";
import { useParams, usePathname } from "next/navigation";
import { CiMenuFries } from "react-icons/ci";
import { IoCloseOutline } from "react-icons/io5";
import { useTranslations } from "next-intl";
import LanguageSwitcher from "../ui/LanguageSwitcher";
@@ -12,13 +13,14 @@ export default function Header() {
const params = useParams<{ locale?: string }>();
const pathname = usePathname();
const locale = params?.locale ?? "fr";
const t = useTranslations('header');
const homePath = `/${locale}`;
const links = [
{ text: "Accueil", target: homePath },
{ text: "Travaux", target: `${homePath}#works` },
{ text: "A propos", target: `${homePath}#about` },
{ text: "Blog", target: `${homePath}/blog` },
{ text: t('home'), target: homePath },
{ text: t('works'), target: `${homePath}#works` },
{ text: t('about'), target: `${homePath}#about` },
{ text: t('blog'), target: `${homePath}/blog` },
];
const [isOpen, setIsOpen] = useState(false);