Sprachumschalter-Komponente (LanguageSwitcher) ergaenzt, in PostfachPage eingebunden; Nachrichtenzahl nutzt jetzt formatNumber(locale) statt reiner String-Konvertierung (Akzeptanzkriterium 3, Zahlenformat). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
30 lines
819 B
TypeScript
30 lines
819 B
TypeScript
"use client";
|
|
|
|
import { useI18n } from "@nexarch/shl";
|
|
import "../lib/messages";
|
|
|
|
export function LanguageSwitcher() {
|
|
const { locale, setLocale, t } = useI18n();
|
|
|
|
return (
|
|
<div role="group" aria-label={t("mail.postfach.languageSwitcherLabel", "Sprache")} style={{ display: "flex", gap: 4 }}>
|
|
<button
|
|
type="button"
|
|
onClick={() => setLocale("de")}
|
|
aria-pressed={locale === "de"}
|
|
style={{ fontWeight: locale === "de" ? 700 : 400 }}
|
|
>
|
|
{t("mail.postfach.languageDe", "Deutsch")}
|
|
</button>
|
|
<button
|
|
type="button"
|
|
onClick={() => setLocale("en")}
|
|
aria-pressed={locale === "en"}
|
|
style={{ fontWeight: locale === "en" ? 700 : 400 }}
|
|
>
|
|
{t("mail.postfach.languageEn", "English")}
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|