No configuration setup. Wordpress compatible.

This commit is contained in:
HenriT
2021-08-30 20:44:36 +03:00
parent f3e7706506
commit 7f131c1ce5
3 changed files with 5 additions and 3 deletions

View File

@ -2,7 +2,8 @@
export default { export default {
storageType: 'local', 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_url: wordpress.api_url,
// api_nonce: wordpress.nonce, // api_nonce: wordpress.nonce,
}; };

View File

@ -16,7 +16,7 @@ const initialized = i18next.init({
fallbackLng: 'en', fallbackLng: 'en',
whitelist: ['en', 'fr', 'et', 'fa', 'bn', 'es'], whitelist: ['en', 'fr', 'et', 'fa', 'bn', 'es'],
backend: { 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: { detection: {
order: ['querystring', 'path', 'localStorage', 'navigator'], order: ['querystring', 'path', 'localStorage', 'navigator'],

View File

@ -2,6 +2,7 @@ import Vue from 'vue';
import Router from 'vue-router'; import Router from 'vue-router';
import store from '@/store/store'; import store from '@/store/store';
import i18n from '@/config/i18n.config'; import i18n from '@/config/i18n.config';
import config from '@/config/app.config';
Vue.use(Router); Vue.use(Router);
@ -37,7 +38,7 @@ const routes = [
const router = new Router({ const router = new Router({
mode: 'history', mode: 'history',
base: process.env.BASE_URL, base: config.base_url,
routes, routes,
}); });