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:
soroush.asadi
2026-06-02 09:59:07 +03:30
parent 3fc7bf2b97
commit 1aacf8bd5d
3 changed files with 16 additions and 22 deletions
+9
View File
@@ -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);