diff --git a/js/control/TrackAnalysis.js b/js/control/TrackAnalysis.js index 3b92528a..abcb9276 100644 --- a/js/control/TrackAnalysis.js +++ b/js/control/TrackAnalysis.js @@ -180,13 +180,19 @@ BR.TrackAnalysis = L.Class.extend({ case 'surface': case 'smoothness': if (typeof analysis[tagName][wayTagParts[1]] === 'undefined') { - let formattedName = i18next.t([ - 'sidebar.analysis.data.' + tagName + '.' + wayTagParts[1], - wayTagParts[1], - ]); + let formattedName; + if (tagName.indexOf('maxspeed') === 0) { - formattedName += ' km/h'; + formattedName = i18next.t('sidebar.analysis.data.maxspeed', { + maxspeed: wayTagParts[1], + }); + } else { + formattedName = i18next.t([ + 'sidebar.analysis.data.' + tagName + '.' + wayTagParts[1], + wayTagParts[1], + ]); } + analysis[tagName][wayTagParts[1]] = { formatted_name: formattedName, name: wayTagParts[1], diff --git a/locales/en.json b/locales/en.json index 5ecb5349..309d85ed 100644 --- a/locales/en.json +++ b/locales/en.json @@ -338,7 +338,8 @@ "horrible": "Horrible", "very_horrible": "Very Horrible", "impassable": "Impassable" - } + }, + "maxspeed": "{{maxspeed}} km/h" }, "header": { "highway": "Highway",