* 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>
21 lines
570 B
TypeScript
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
|
|
},
|
|
});
|