Set the config option hideDefaultLocaleInURL in URL

parent fdfcdfef
...@@ -42753,15 +42753,21 @@ _vue2.default.component('SingleMedia', __webpack_require__(184)); ...@@ -42753,15 +42753,21 @@ _vue2.default.component('SingleMedia', __webpack_require__(184));
_vue2.default.component('MediaManager', __webpack_require__(43)); _vue2.default.component('MediaManager', __webpack_require__(43));
var currentLocale = window.AsgardCMS.currentLocale;
var adminPrefix = window.AsgardCMS.adminPrefix;
var router = new _vueRouter2.default({ var router = new _vueRouter2.default({
mode: 'history', mode: 'history',
base: currentLocale + '/' + adminPrefix, base: makeBaseUrl(),
routes: [].concat(_toConsumableArray(_PageRoutes2.default), _toConsumableArray(_MediaRoutes2.default)) 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 messages = _defineProperty({}, currentLocale, window.AsgardCMS.translations);
var i18n = new _vueI18n2.default({ var i18n = new _vueI18n2.default({
...@@ -27,18 +27,24 @@ Vue.component('MediaManager', require('../../../Modules/Media/Assets/js/componen ...@@ -27,18 +27,24 @@ Vue.component('MediaManager', require('../../../Modules/Media/Assets/js/componen
import PageRoutes from '../../../Modules/Page/Assets/js/PageRoutes'; import PageRoutes from '../../../Modules/Page/Assets/js/PageRoutes';
import MediaRoutes from '../../../Modules/Media/Assets/js/MediaRoutes'; import MediaRoutes from '../../../Modules/Media/Assets/js/MediaRoutes';
const currentLocale = window.AsgardCMS.currentLocale;
const adminPrefix = window.AsgardCMS.adminPrefix;
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
base: `${currentLocale}/${adminPrefix}`, base: makeBaseUrl(),
routes : [ routes : [
...PageRoutes, ...PageRoutes,
...MediaRoutes, ...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 = { let messages = {
[currentLocale]: window.AsgardCMS.translations, [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