use i18next interpolation instead of concatenating strings
This commit is contained in:
parent
8c21a88b15
commit
59a14356f7
2 changed files with 13 additions and 6 deletions
|
|
@ -180,13 +180,19 @@ BR.TrackAnalysis = L.Class.extend({
|
|||
case 'surface':
|
||||
case 'smoothness':
|
||||
if (typeof analysis[tagName][wayTagParts[1]] === 'undefined') {
|
||||
let formattedName = i18next.t([
|
||||
let formattedName;
|
||||
|
||||
if (tagName.indexOf('maxspeed') === 0) {
|
||||
formattedName = i18next.t('sidebar.analysis.data.maxspeed', {
|
||||
maxspeed: wayTagParts[1],
|
||||
});
|
||||
} else {
|
||||
formattedName = i18next.t([
|
||||
'sidebar.analysis.data.' + tagName + '.' + wayTagParts[1],
|
||||
wayTagParts[1],
|
||||
]);
|
||||
if (tagName.indexOf('maxspeed') === 0) {
|
||||
formattedName += ' km/h';
|
||||
}
|
||||
|
||||
analysis[tagName][wayTagParts[1]] = {
|
||||
formatted_name: formattedName,
|
||||
name: wayTagParts[1],
|
||||
|
|
|
|||
|
|
@ -338,7 +338,8 @@
|
|||
"horrible": "Horrible",
|
||||
"very_horrible": "Very Horrible",
|
||||
"impassable": "Impassable"
|
||||
}
|
||||
},
|
||||
"maxspeed": "{{maxspeed}} km/h"
|
||||
},
|
||||
"header": {
|
||||
"highway": "Highway",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue