Fix dynamic default locale routing

This commit is contained in:
MOH
2026-03-15 04:41:08 +01:00
parent 50c3f5cce9
commit 364f761420
13 changed files with 73 additions and 32 deletions
+3 -1
View File
@@ -17,6 +17,7 @@ const PENDING_TOAST_STORAGE_KEY = "mohfarawati-pending-toast";
type LocaleToggleProps = {
locale: string;
defaultLocale?: AppLocale;
className?: string;
showLabel?: boolean;
};
@@ -29,6 +30,7 @@ const localeChangedMessages: Record<AppLocale, string> = {
export function LocaleToggle({
locale,
defaultLocale = "de",
className,
showLabel = false,
}: LocaleToggleProps) {
@@ -82,7 +84,7 @@ export function LocaleToggle({
)}
>
<a
href={getLocalizedPath(targetLocale, currentPath)}
href={getLocalizedPath(targetLocale, currentPath, defaultLocale)}
onClick={() => {
const message = localeChangedMessages[targetLocale];