diff --git a/app/assets/javascripts/admin/addon/models/report.js b/app/assets/javascripts/admin/addon/models/report.js index 34d268fac8d..868cc28e441 100644 --- a/app/assets/javascripts/admin/addon/models/report.js +++ b/app/assets/javascripts/admin/addon/models/report.js @@ -407,12 +407,21 @@ export default class Report extends EmberObject { changeTitle(valAtT1, valAtT2, prevPeriodString) { const change = this.percentChangeString(valAtT1, valAtT2); - let title = ""; + const title = []; if (change) { - title += `${change} change. `; + title.push( + i18n("admin.dashboard.reports.percent_change_tooltip", { + percent: change, + }) + ); } - title += `Was ${number(valAtT1)} ${prevPeriodString}.`; - return title; + title.push( + i18n("admin.dashboard.reports.percent_change_tooltip_previous_value", { + previousValue: number(valAtT1), + previousPeriod: prevPeriodString, + }) + ); + return title.join(" "); } @discourseComputed("yesterdayCount") diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index d2d25f39810..ad98210d3cd 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -5217,6 +5217,8 @@ en: reports: trend_title: "%{percent} change. Currently %{current}, was %{prev} in previous period." + percent_change_tooltip: "%{percent} change." + percent_change_tooltip_previous_value: "Was %{previousValue} %{previousPeriod}." today: "Today" yesterday: "Yesterday" last_7_days: "Last 7"