feat: Implement internationalization with react-i18next, add translation files, and integrate language switching across components.

This commit is contained in:
2025-12-26 15:23:15 +01:00
parent 19434cc71a
commit e44771902c
15 changed files with 505 additions and 74 deletions

23
k-notes-frontend/i18n.ts Normal file
View File

@@ -0,0 +1,23 @@
import i18next from "i18next";
import { initReactI18next } from "react-i18next";
import HttpBackend from "i18next-http-backend";
import LanguageDetector from "i18next-browser-languagedetector";
i18next
.use(HttpBackend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
fallbackLng: "en",
supportedLngs: ["en", "pl"],
backend: {
loadPath: "/locales/{{lng}}/{{ns}}.json",
},
detection: {
order: ["localStorage", "navigator"],
caches: ["localStorage"],
},
interpolation: {
escapeValue: false,
},
});