fix(web): loading from root instead of base path (#3342)
This fixes an issue where we were loading the locales from the root rather than the base path.pull/3349/head^2
parent
b7e40d7319
commit
cb46e9064b
|
@ -3,6 +3,10 @@ import LanguageDetector from "i18next-browser-languagedetector";
|
||||||
import Backend from "i18next-http-backend";
|
import Backend from "i18next-http-backend";
|
||||||
import { initReactI18next } from "react-i18next";
|
import { initReactI18next } from "react-i18next";
|
||||||
|
|
||||||
|
import { getBasePath } from "@utils/BasePath";
|
||||||
|
|
||||||
|
const basePath = getBasePath();
|
||||||
|
|
||||||
i18n.use(Backend)
|
i18n.use(Backend)
|
||||||
.use(LanguageDetector)
|
.use(LanguageDetector)
|
||||||
.use(initReactI18next)
|
.use(initReactI18next)
|
||||||
|
@ -12,7 +16,7 @@ i18n.use(Backend)
|
||||||
lookupQuerystring: "lng",
|
lookupQuerystring: "lng",
|
||||||
},
|
},
|
||||||
backend: {
|
backend: {
|
||||||
loadPath: "/locales/{{lng}}/{{ns}}.json",
|
loadPath: basePath + "/locales/{{lng}}/{{ns}}.json",
|
||||||
},
|
},
|
||||||
ns: ["portal"],
|
ns: ["portal"],
|
||||||
defaultNS: "portal",
|
defaultNS: "portal",
|
||||||
|
|
Loading…
Reference in New Issue