mirror of
https://github.com/mokuappio/serverless-invoices.git
synced 2025-10-27 07:51:08 -04:00
Make locale url also work with nested wordpress backend.
This commit is contained in:
@ -11,12 +11,16 @@ i18next
|
||||
.use(LanguageDetector)
|
||||
.use(Backend);
|
||||
|
||||
console.log(process.env.BASE_URL);
|
||||
const path = window.name
|
||||
? JSON.parse(window.name).front_url
|
||||
: `${window.location.origin}${process.env.BASE_URL}`;
|
||||
|
||||
|
||||
const initialized = i18next.init({
|
||||
fallbackLng: 'en',
|
||||
whitelist: ['en', 'fr', 'et', 'fa', 'bn', 'es'],
|
||||
backend: {
|
||||
loadPath: `${window.location.origin}${process.env.BASE_URL}/locales/{{lng}}/{{ns}}.json`,
|
||||
loadPath: `${path}/locales/{{lng}}/{{ns}}.json`,
|
||||
},
|
||||
detection: {
|
||||
order: ['querystring', 'path', 'localStorage', 'navigator'],
|
||||
|
||||
@ -3,7 +3,7 @@ import app from '@/main';
|
||||
import NotificationService from '@/services/notification.service';
|
||||
import { removeVuexORMFlags } from '@/utils/helpers';
|
||||
|
||||
const config = window.name ? JSON.parse(window.name) : { api_url: '', nonce: '' };
|
||||
const config = window.name ? JSON.parse(window.name) : { front_url: '', api_url: '', nonce: '' };
|
||||
|
||||
const http = axios.create({
|
||||
baseURL: config.api_url,
|
||||
|
||||
Reference in New Issue
Block a user