feat(web): HU | EN language switcher in the header (MITHOME-115)

A compact "HU | EN" switcher next to the theme toggle (desktop) and the
menu button (mobile). Each link opens the current page in the other
language with its translated slug (/hu/szolgaltatasok <-> /en/services),
unknown pages fall back to the language's home. English is always
offered (user decision), even before a page's English is approved.

Links carry lang/hrefLang, the active one aria-current, and the group a
localized accessible name. No flags: a flag marks a country, not a
language. Unit and component tests plus staging smoke SMOKE-08.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Do Siki
2026-09-29 12:22:11 +02:00
co-authored by Claude Opus 5.5
parent 8687ae28a2
commit 2bb9f122d5
9 changed files with 184 additions and 4 deletions
+2 -1
View File
@@ -3,7 +3,7 @@ import Header from '../../../components/Header'
import Footer from '../../../components/Footer'
import { isLocale, localePath, type Locale } from '@/lib/i18n'
import { getCommonContent, getHomeContent } from '@/lib/payload-content'
import { siteConfig, getMainNavigation, getFooterNavigation, getFooterLegalLinks, getSiteDescription } from '@/config/site'
import { siteConfig, getMainNavigation, getFooterNavigation, getFooterLegalLinks, getSiteDescription, getLanguageSwitcherLabel } from '@/config/site'
// WHY force-dynamic (MITHOME-97): ezek az oldalak a Payload Local API-t hívják
// (élő MongoDB-olvasás). generateStaticParams + SSG mellett a build időben
@@ -43,6 +43,7 @@ export default async function LocaleLayout({
nav={getMainNavigation(locale)}
homeHref={localePath(locale)}
a11y={common.a11y}
languageLabel={getLanguageSwitcherLabel(locale)}
/>
<main className="flex-1">
{children}