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 { initReactI18next } from "react-i18next";
|
||||
|
||||
import { getBasePath } from "@utils/BasePath";
|
||||
|
||||
const basePath = getBasePath();
|
||||
|
||||
i18n.use(Backend)
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
|
@ -12,7 +16,7 @@ i18n.use(Backend)
|
|||
lookupQuerystring: "lng",
|
||||
},
|
||||
backend: {
|
||||
loadPath: "/locales/{{lng}}/{{ns}}.json",
|
||||
loadPath: basePath + "/locales/{{lng}}/{{ns}}.json",
|
||||
},
|
||||
ns: ["portal"],
|
||||
defaultNS: "portal",
|
||||
|
|
Loading…
Reference in New Issue