fix(admin-ui): Patch admin path issue (#5154)

This commit is contained in:
Oli Juhl
2023-09-20 16:31:15 +02:00
committed by GitHub
parent 8b189d2b90
commit 54531e38bc
4 changed files with 35 additions and 7 deletions
+3 -4
View File
@@ -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)