diff --git a/config.template.js b/config.template.js index 28ea8d1..3a410e9 100644 --- a/config.template.js +++ b/config.template.js @@ -54,9 +54,14 @@ 'vm-forum-velomobil-schnell', 'fastbike-lowtraffic', 'fastbike-asia-pacific', - 'hiking-beta', + 'hiking-mountain', ]; + // Map old, renamed legacy profile to new name (from hash of shared or bookmarked URLs) + BR.conf.profilesRename = { + 'hiking-beta': 'hiking-mountain', + }; + // Removes default base layers when 'true'. Useful for only having custom layers (see below). BR.conf.clearBaseLayers = false; diff --git a/js/router/BRouter.js b/js/router/BRouter.js index 530ff1b..0f81a95 100644 --- a/js/router/BRouter.js +++ b/js/router/BRouter.js @@ -95,7 +95,7 @@ L.BRouter = L.Class.extend({ opts.alternative = params.alternativeidx; } if (params.profile) { - opts.profile = params.profile; + opts.profile = this._parseProfile(params.profile); } if (params.pois) { opts.pois = this._parseLonLatNames(params.pois); @@ -498,6 +498,14 @@ L.BRouter = L.Class.extend({ return nogos; }, + _parseProfile: function (profile) { + if (BR.conf.profilesRename?.[profile]) { + return BR.conf.profilesRename[profile]; + } + + return profile; + }, + // formats L.LatLng object as lng,lat string _formatLatLng: function (latLng) { var s = ''; diff --git a/locales/en.json b/locales/en.json index 6004073..f18c39a 100644 --- a/locales/en.json +++ b/locales/en.json @@ -197,7 +197,7 @@ "fastbike": "Fastbike", "fastbike-asia-pacific": "Fastbike (Asia Pacific)", "fastbike-lowtraffic": "Fastbike (low traffic)", - "hiking-beta": "Hiking (beta)", + "hiking-mountain": "Hiking", "moped": "Moped", "rail": "Rail", "river": "River", diff --git a/locales/keys.js b/locales/keys.js index 8d1f07b..b2f011e 100644 --- a/locales/keys.js +++ b/locales/keys.js @@ -36,7 +36,7 @@ i18next.t('navbar.profile.fastbike'); i18next.t('navbar.profile.fastbike-asia-pacific'); i18next.t('navbar.profile.fastbike-asia-pacific'); i18next.t('navbar.profile.fastbike-lowtraffic'); -i18next.t('navbar.profile.hiking-beta'); +i18next.t('navbar.profile.hiking-mountain'); i18next.t('navbar.profile.moped'); i18next.t('navbar.profile.rail'); i18next.t('navbar.profile.river');