Files
homarr/packages/translation/src/routing.ts
homarr-renovate[bot] f55d8a9c2e fix(deps): update dependency next-intl to v4 (#2580)
* fix(deps): update dependency next-intl to v4

* fix: typecheck issue

* refactor: implement improvements for next-intl v4

* fix: typecheck issues

* fix: typecheck issue

---------

Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2025-03-12 18:37:43 +01:00

21 lines
570 B
TypeScript

import { defineRouting } from "next-intl/routing";
import { localeCookieKey } from "@homarr/definitions";
import type { SupportedLanguage } from "./config";
import { supportedLanguages } from "./config";
export const createRouting = (defaultLocale: SupportedLanguage) =>
defineRouting({
locales: supportedLanguages,
defaultLocale,
localeCookie: {
name: localeCookieKey,
// 1 year
maxAge: 60 * 60 * 24 * 365,
},
localePrefix: {
mode: "never", // Rewrite the URL with locale parameter but without shown in url
},
});