sendou.ink/app/modules/i18n/loader.ts
dependabot[bot] 0d473379da
Some checks are pending
E2E Tests / e2e (push) Waiting to run
Tests and checks on push / run-checks-and-tests (push) Waiting to run
Updates translation progress / update-translation-progress-issue (push) Waiting to run
build(deps): bump i18next from 25.10.10 to 26.0.7 (#3029)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kalle <38327916+Sendouc@users.noreply.github.com>
2026-05-02 16:36:55 +03:00

33 lines
812 B
TypeScript

import i18next from "i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import Backend from "i18next-http-backend";
import { initReactI18next } from "react-i18next";
import { getInitialNamespaces } from "remix-i18next/client";
import { config } from "./config";
export function i18nLoader() {
return i18next
.use(initReactI18next)
.use(LanguageDetector)
.use(Backend)
.init({
...config,
ns: getInitialNamespaces(),
backend: {
loadPath: (lng: any, ns: any) => {
// use vite static asset fingerprinting
return new URL(
`../../../locales/${lng[0]}/${ns[0]}.json`,
import.meta.url,
).href;
},
},
detection: {
order: ["htmlTag"],
caches: [],
},
// without this hydration fails in E2E tests
initAsync: false,
});
}