fix(i18n): working locale switcher + RTL category sidebar
- add src/i18n/navigation.ts (next-intl createNavigation) and rewire
LanguageSwitcher to router.replace(pathname, { locale }) — the manual
next/navigation path-munging didn't switch locale reliably
- VideoTemplatesCategorySidebar: text-left → text-start, ml-auto → ms-auto
so labels/badges align correctly under dir="rtl"
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { createNavigation } from "next-intl/navigation";
|
||||
|
||||
import { routing } from "./routing";
|
||||
|
||||
// Locale-aware navigation wrappers. `usePathname` returns the path WITHOUT the locale
|
||||
// prefix, and `useRouter().replace(path, { locale })` switches locale correctly for the
|
||||
// `as-needed` prefix strategy — which manual string-munging of next/navigation does not.
|
||||
export const { Link, redirect, usePathname, useRouter, getPathname } =
|
||||
createNavigation(routing);
|
||||
Reference in New Issue
Block a user