From ad3f4a8a3b9f00c43a9c99aaa8361fcdeffaa82e Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:05:57 +0330 Subject: [PATCH] Import source: src/i18n/routing Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- src/i18n/routing.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/i18n/routing.ts diff --git a/src/i18n/routing.ts b/src/i18n/routing.ts new file mode 100644 index 0000000..5985c3b --- /dev/null +++ b/src/i18n/routing.ts @@ -0,0 +1,19 @@ +import {defineRouting} from 'next-intl/routing'; +import {createNavigation} from 'next-intl/navigation'; + +export const routing = defineRouting({ + // A list of all locales that are supported + locales: ['en', 'fa'], + + // Used when no locale matches + defaultLocale: 'en', + + // Custom prefix mode so that default locale doesn't get prefix + localePrefix: 'as-needed' +}); + +// Lightweight wrappers around Next.js' navigation APIs +// that will automatically consider the routing configuration +export const {Link, redirect, usePathname, useRouter, getPathname} = + createNavigation(routing); +