first
This commit is contained in:
commit
8538ab969a
434 changed files with 44051 additions and 0 deletions
20
apps/web/modules/i18n/routing.ts
Normal file
20
apps/web/modules/i18n/routing.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { config } from "@repo/config";
|
||||
import { createNavigation } from "next-intl/navigation";
|
||||
import { defineRouting } from "next-intl/routing";
|
||||
|
||||
export const routing = defineRouting({
|
||||
locales: Object.keys(config.i18n.locales),
|
||||
defaultLocale: config.i18n.defaultLocale,
|
||||
localeCookie: {
|
||||
name: config.i18n.localeCookieName,
|
||||
},
|
||||
localePrefix: config.i18n.enabled ? "always" : "never",
|
||||
localeDetection: config.i18n.enabled,
|
||||
});
|
||||
|
||||
export const {
|
||||
Link: LocaleLink,
|
||||
redirect: localeRedirect,
|
||||
usePathname: useLocalePathname,
|
||||
useRouter: useLocaleRouter,
|
||||
} = createNavigation(routing);
|
||||
Loading…
Add table
Add a link
Reference in a new issue