Add .jsx
filename extension
(This is also required for Vite later)
This commit is contained in:
parent
d7eb1206fe
commit
f558b4dbe9
25 changed files with 0 additions and 0 deletions
29
web/src/components/i18n.jsx
Normal file
29
web/src/components/i18n.jsx
Normal file
|
@ -0,0 +1,29 @@
|
|||
import i18n from "i18next";
|
||||
import Backend from "i18next-http-backend";
|
||||
import LanguageDetector from "i18next-browser-languagedetector";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
|
||||
// Translations using i18next
|
||||
// - Options: https://www.i18next.com/overview/configuration-options
|
||||
// - Browser Language Detector: https://github.com/i18next/i18next-browser-languageDetector
|
||||
// - HTTP Backend (load files via fetch): https://github.com/i18next/i18next-http-backend
|
||||
//
|
||||
// See example project here:
|
||||
// https://github.com/i18next/react-i18next/tree/master/example/react
|
||||
|
||||
i18n
|
||||
.use(Backend)
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
fallbackLng: "en",
|
||||
debug: true,
|
||||
interpolation: {
|
||||
escapeValue: false, // not needed for react as it escapes by default
|
||||
},
|
||||
backend: {
|
||||
loadPath: "/static/langs/{{lng}}.json",
|
||||
},
|
||||
});
|
||||
|
||||
export default i18n;
|
Loading…
Add table
Add a link
Reference in a new issue