Skip to content

Commit

Permalink
Merge pull request #461 from ziegenberg/replace-deprecated-i18next-xh…
Browse files Browse the repository at this point in the history
…r-backend

Replace deprecated i18next-xhr-backend with i18next-http-backend
  • Loading branch information
lkiesow committed May 31, 2024
2 parents fd2df20 + 8df5fcd commit 6e61447
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 6e61447

Please sign in to comment.