mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-24 04:22:10 -05:00
* Initial * CSS lint * Test CI * Add 1v1, 2v2, and 3v3 Tags (#1771) * Initial * CSS lint * Test CI * Rename step --------- Co-authored-by: xi <104683822+ximk@users.noreply.github.com>
31 lines
694 B
TypeScript
31 lines
694 B
TypeScript
import { resolve } from "node:path";
|
|
import { createCookie } from "@remix-run/node";
|
|
import Backend from "i18next-fs-backend";
|
|
import { RemixI18Next } from "remix-i18next/server";
|
|
import { config } from "./config";
|
|
|
|
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,
|
|
backend: {
|
|
loadPath: resolve("./locales/{{lng}}/{{ns}}.json"),
|
|
},
|
|
},
|
|
backend: Backend,
|
|
});
|
|
|
|
export default i18next;
|