fix(admin-ui): Patch admin path issue (#5154)
This commit is contained in:
@@ -2,6 +2,7 @@ import i18n from "i18next"
|
||||
import LanguageDetector from "i18next-browser-languagedetector"
|
||||
import Backend from "i18next-http-backend"
|
||||
import { initReactI18next } from "react-i18next"
|
||||
import { getFullAdminPath } from "../utils/get-admin-path"
|
||||
|
||||
export const supportedLanguages = [
|
||||
{
|
||||
@@ -22,10 +23,8 @@ export const supportedLanguages = [
|
||||
},
|
||||
]
|
||||
|
||||
const backendUrl = window.location.origin
|
||||
const adminPath = process.env.ADMIN_PATH ? `${process.env.ADMIN_PATH}/` : "/"
|
||||
|
||||
const pathToLoadFrom = `${backendUrl}${adminPath}public/locales/{{lng}}/{{ns}}.json`
|
||||
const adminPath = getFullAdminPath()
|
||||
const pathToLoadFrom = `${adminPath}public/locales/{{lng}}/{{ns}}.json`
|
||||
|
||||
void i18n
|
||||
.use(Backend)
|
||||
|
||||
Reference in New Issue
Block a user