Skip to content

Commit

Permalink
Replace deprecated i18next-xhr-backend with i18next-http-backend
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Ziegenberg <[email protected]>
  • Loading branch information
ziegenberg committed May 31, 2024
1 parent 7d84ae0 commit 8df5fcd
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 11 deletions.
65 changes: 58 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"http-proxy-middleware": "^2.0.6",
"i18next": "^23.11.5",
"i18next-browser-languagedetector": "^7.2.0",
"i18next-xhr-backend": "^3.2.2",
"i18next-http-backend": "^2.5.2",
"lodash": "^4.17.21",
"moment": "^2.30.1",
"moment-timezone": "^0.5.45",
Expand Down
6 changes: 3 additions & 3 deletions src/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import moment from "moment";

import Backend from "i18next-xhr-backend";
import HttpBackend, { HttpBackendOptions } from "i18next-http-backend";
import LanguageDetector from "i18next-browser-languagedetector";

// import language files
Expand Down Expand Up @@ -62,10 +62,10 @@ const resources = {

// Configuration of i18next
i18n
.use(Backend)
.use(HttpBackend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
.init<HttpBackendOptions>({
resources,
fallbackLng: "en-US",
debug: true,
Expand Down

0 comments on commit 8df5fcd

Please sign in to comment.