diff --git a/src/config/app.config.example.js b/src/config/app.config.example.js index c48f9aa..4b6df0c 100644 --- a/src/config/app.config.example.js +++ b/src/config/app.config.example.js @@ -2,7 +2,8 @@ export default { storageType: 'local', - // locales_url: wordpress.front_url, + // base_url: wordpress.front_url, + // base_url: `${window.location.origin}${process.env.BASE_URL}` // api_url: wordpress.api_url, // api_nonce: wordpress.nonce, }; diff --git a/src/config/i18n.config.js b/src/config/i18n.config.js index bf21571..853484c 100644 --- a/src/config/i18n.config.js +++ b/src/config/i18n.config.js @@ -16,7 +16,7 @@ const initialized = i18next.init({ fallbackLng: 'en', whitelist: ['en', 'fr', 'et', 'fa', 'bn', 'es'], backend: { - loadPath: config.locales_url || `${window.location.origin}${process.env.BASE_URL}/locales/{{lng}}/{{ns}}.json`, + loadPath: `${config.base_url || ''}/locales/{{lng}}/{{ns}}.json`, }, detection: { order: ['querystring', 'path', 'localStorage', 'navigator'], diff --git a/src/router.js b/src/router.js index 673f3c5..686ca82 100644 --- a/src/router.js +++ b/src/router.js @@ -2,6 +2,7 @@ import Vue from 'vue'; import Router from 'vue-router'; import store from '@/store/store'; import i18n from '@/config/i18n.config'; +import config from '@/config/app.config'; Vue.use(Router); @@ -37,7 +38,7 @@ const routes = [ const router = new Router({ mode: 'history', - base: process.env.BASE_URL, + base: config.base_url, routes, });