Rename hiking-beta profile to hiking-mountain

- remove " (beta)" in locale text, stick to plain "Hiking" as long as we have only one and base parameters stay the same
- map hash for old URLs
This commit is contained in:
Norbert Renner 2022-05-23 11:34:03 +02:00
parent 84fa50b5c2
commit 5cc64015b9
4 changed files with 17 additions and 4 deletions

View file

@ -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;

View file

@ -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 = '';

View file

@ -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",

View file

@ -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');