mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 04:02:40 -05:00
25 lines
567 B
TypeScript
25 lines
567 B
TypeScript
import { createCookie } from "react-router";
|
|
import { RemixI18Next } from "remix-i18next/server";
|
|
import { config } from "./config";
|
|
import { resources } from "./resources.server";
|
|
|
|
const TEN_YEARS_IN_SECONDS = 31_536_000 * 10;
|
|
|
|
export const i18nCookie = createCookie("i18n", {
|
|
sameSite: "lax",
|
|
path: "/",
|
|
maxAge: TEN_YEARS_IN_SECONDS,
|
|
});
|
|
|
|
export const i18next = new RemixI18Next({
|
|
detection: {
|
|
cookie: i18nCookie,
|
|
supportedLanguages: config.supportedLngs,
|
|
fallbackLanguage: config.fallbackLng,
|
|
},
|
|
i18next: {
|
|
...config,
|
|
resources: resources,
|
|
},
|
|
});
|