sendou.ink/app/modules/i18n/i18next.server.ts
Kalle fd48bced91
Migrate Prettier/Eslint/Stylelint setup to Biome (#1772)
* 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>
2024-06-24 13:07:17 +03:00

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;