From 719734db3e6b9ba371f0c8120d369c625c5b8341 Mon Sep 17 00:00:00 2001 From: svmidi Date: Fri, 15 Nov 2024 11:07:54 +0300 Subject: [PATCH 1/2] Update TrackAnalysis.js Added translation of track in analytics --- js/control/TrackAnalysis.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/control/TrackAnalysis.js b/js/control/TrackAnalysis.js index abcb9276..957d76c0 100644 --- a/js/control/TrackAnalysis.js +++ b/js/control/TrackAnalysis.js @@ -159,7 +159,10 @@ BR.TrackAnalysis = L.Class.extend({ let trackType = ''; if (highwayType === 'track') { trackType = this.getTrackType(wayTags); - highwayType = 'Track ' + trackType; + highwayType = i18next.t( + 'sidebar.analysis.data.highway.' + highwayType, + highwayType + ) + ' ' + trackType; } if (typeof analysis.highway[highwayType] === 'undefined') { analysis.highway[highwayType] = { From a5b32889f2617dc1d8a7a58131b9bb8ea282c469 Mon Sep 17 00:00:00 2001 From: svmidi Date: Fri, 15 Nov 2024 11:24:30 +0300 Subject: [PATCH 2/2] Add translate for distance point (km) --- js/control/TrackAnalysis.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/control/TrackAnalysis.js b/js/control/TrackAnalysis.js index 957d76c0..55a21265 100644 --- a/js/control/TrackAnalysis.js +++ b/js/control/TrackAnalysis.js @@ -417,7 +417,7 @@ BR.TrackAnalysis = L.Class.extend({ data-subtype="${data[index].subtype}" \ data-distance="${data[index].distance}">`); $row.append(`${data[index].formatted_name}`); - $row.append(`${this.formatDistance(data[index].distance)} km`); + $row.append(`${this.formatDistance(data[index].distance)} ${i18next.t('footer.kilometer-abbrev')}`); $tbody.append($row); totalDistance += data[index].distance; } @@ -430,7 +430,7 @@ BR.TrackAnalysis = L.Class.extend({ $( `${this.formatDistance( this.totalRouteDistance - totalDistance - )} km` + )} ${i18next.t('footer.kilometer-abbrev')}` ) ) ); @@ -446,7 +446,7 @@ BR.TrackAnalysis = L.Class.extend({ $( `${this.formatDistance( totalDistance - )} km` + )} ${i18next.t('footer.kilometer-abbrev')}` ) ) );