feat(website/i18n): set up

This commit is contained in:
Elian Doran
2025-10-11 20:46:29 +03:00
parent 2751aecab9
commit 2c71e995f2
4 changed files with 28 additions and 9 deletions

View File

@@ -8,6 +8,8 @@
"preview": "pnpm build && vite preview"
},
"dependencies": {
"i18next": "25.6.0",
"i18next-http-backend": "3.0.2",
"preact": "10.27.2",
"preact-iso": "2.11.0",
"preact-render-to-string": "6.6.2"

16
apps/website/src/i18n.ts Normal file
View File

@@ -0,0 +1,16 @@
import { default as i18next } from "i18next";
import HttpApi from 'i18next-http-backend';
console.log("INIT I18NEXT");
i18next.use(HttpApi)
await i18next.init({
debug: true,
lng: "en",
fallbackLng: "en",
backend: {
loadPath: "/translations/{{lng}}/{{ns}}.json",
},
returnEmptyString: false
});
export const t = i18next.t;