Set the config option hideDefaultLocaleInURL in URL

parent fdfcdfef
......@@ -42753,15 +42753,21 @@ _vue2.default.component('SingleMedia', __webpack_require__(184));
_vue2.default.component('MediaManager', __webpack_require__(43));
var currentLocale = window.AsgardCMS.currentLocale;
var adminPrefix = window.AsgardCMS.adminPrefix;
var router = new _vueRouter2.default({
mode: 'history',
base: currentLocale + '/' + adminPrefix,
base: makeBaseUrl(),
routes: [].concat(_toConsumableArray(_PageRoutes2.default), _toConsumableArray(_MediaRoutes2.default))
});
var currentLocale = window.AsgardCMS.currentLocale;
var adminPrefix = window.AsgardCMS.adminPrefix;
function makeBaseUrl() {
if (window.AsgardCMS.hideDefaultLocaleInURL == 1) {
return adminPrefix;
}
return currentLocale + '/' + adminPrefix;
}
var messages = _defineProperty({}, currentLocale, window.AsgardCMS.translations);
var i18n = new _vueI18n2.default({
......@@ -27,18 +27,24 @@ Vue.component('MediaManager', require('../../../Modules/Media/Assets/js/componen
import PageRoutes from '../../../Modules/Page/Assets/js/PageRoutes';
import MediaRoutes from '../../../Modules/Media/Assets/js/MediaRoutes';
const currentLocale = window.AsgardCMS.currentLocale;
const adminPrefix = window.AsgardCMS.adminPrefix;
const router = new VueRouter({
mode: 'history',
base: `${currentLocale}/${adminPrefix}`,
base: makeBaseUrl(),
routes : [
...PageRoutes,
...MediaRoutes,
],
});
const currentLocale = window.AsgardCMS.currentLocale;
const adminPrefix = window.AsgardCMS.adminPrefix;
function makeBaseUrl() {
if (window.AsgardCMS.hideDefaultLocaleInURL == 1) {
return adminPrefix;
}
return `${currentLocale}/${adminPrefix}`;
}
let messages = {
[currentLocale]: window.AsgardCMS.translations,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment