diff --git a/app/components/HeaderClient.tsx b/app/components/HeaderClient.tsx index 55bef47..e253c38 100644 --- a/app/components/HeaderClient.tsx +++ b/app/components/HeaderClient.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import { SiGithub, SiLinkedin } from "react-icons/si"; import Link from "next/link"; import { usePathname, useSearchParams } from "next/navigation"; @@ -27,6 +27,14 @@ export default function HeaderClient({ locale, translations }: HeaderClientProps const [scrolled, setScrolled] = useState(false); const pathname = usePathname(); const searchParams = useSearchParams(); + const prevLocale = useRef(locale); + + useEffect(() => { + if (prevLocale.current !== locale) { + window.scrollTo({ top: 0, behavior: "instant" }); + prevLocale.current = locale; + } + }, [locale]); const isHome = pathname === `/${locale}` || pathname === `/${locale}/`; diff --git a/messages/de.json b/messages/de.json index 72e5f21..b5f6766 100644 --- a/messages/de.json +++ b/messages/de.json @@ -34,7 +34,7 @@ "f2": "Docker Swarm & CI/CD", "f3": "Self-Hosted Infrastruktur" }, - "description": "Ich bin Dennis – Student aus Osnabrück und leidenschaftlicher Self-Hoster. Ich entwickle Full-Stack Apps und sorge am liebsten selbst dafür, dass sie auf meiner eigenen Infrastruktur perfekt laufen.", + "description": "Ich bin Dennis, Student aus Osnabrück und leidenschaftlicher Selfhoster. Ich entwickle Fullstack Apps und sorge am liebsten selbst dafür, dass sie auf meiner eigenen Infrastruktur perfekt laufen.", "ctaWork": "Meine Projekte", "ctaContact": "Kontakt" }, diff --git a/messages/en.json b/messages/en.json index d319dd4..4eb42b7 100644 --- a/messages/en.json +++ b/messages/en.json @@ -35,7 +35,7 @@ "f2": "Docker Swarm & CI/CD", "f3": "Self-Hosted Infrastructure" }, - "description": "I'm Dennis – a student from Germany and a passionate self-hoster. I build full-stack applications and love the challenge of managing the infrastructure they run on.", + "description": "I'm Dennis, a student from Germany and a passionate selfhoster. I build fullstack applications and love the challenge of managing the infrastructure they run on.", "ctaWork": "View Projects", "ctaContact": "Get in touch" },