mediahub-fe/i18n/routing.ts

16 lines
532 B
TypeScript
Raw Normal View History

2025-05-22 09:53:54 +00:00
import { defineRouting } from "next-intl/routing";
import { createSharedPathnamesNavigation } from "next-intl/navigation";
import { locales } from "@/config";
2024-11-26 03:09:48 +00:00
export const routing = defineRouting({
// A list of all locales that are supported
locales: locales,
2025-05-22 09:53:54 +00:00
2024-11-26 03:09:48 +00:00
// Used when no locale matches
2025-05-22 09:53:54 +00:00
defaultLocale: "in",
2024-11-26 03:09:48 +00:00
});
2025-05-22 09:53:54 +00:00
2024-11-26 03:09:48 +00:00
// Lightweight wrappers around Next.js' navigation APIs
// that will consider the routing configuration
2025-05-22 09:53:54 +00:00
export const { Link, redirect, usePathname, useRouter } =
createSharedPathnamesNavigation(routing);