2021-08-27 23:45:25 +00:00
|
|
|
import axios
|
|
|
|
from 'axios';
|
|
|
|
import VueAxios
|
|
|
|
from 'vue-axios';
|
2021-03-16 12:25:29 +00:00
|
|
|
import GetTextPlugin
|
|
|
|
from 'vue-gettext';
|
|
|
|
import translations
|
|
|
|
from '../../resources/locale/translations';
|
2019-10-04 08:02:53 +00:00
|
|
|
|
2021-08-27 23:45:25 +00:00
|
|
|
export default function (lang, csrf) {
|
|
|
|
// Configure localization
|
2019-10-04 08:02:53 +00:00
|
|
|
Vue.use(GetTextPlugin, {
|
|
|
|
defaultLanguage: 'en_US',
|
|
|
|
translations: translations,
|
|
|
|
silent: true
|
2020-06-17 10:44:59 +00:00
|
|
|
});
|
2019-10-04 08:02:53 +00:00
|
|
|
|
2020-06-17 10:44:59 +00:00
|
|
|
Vue.config.language = lang;
|
2021-08-27 23:45:25 +00:00
|
|
|
|
|
|
|
// Configure auto-CSRF on requests
|
|
|
|
axios.defaults.headers.common['X-API-CSRF'] = csrf;
|
|
|
|
|
|
|
|
Vue.use(VueAxios, axios);
|
2019-10-04 08:02:53 +00:00
|
|
|
}
|