From 9985ce077b94ec1e72546bf4c13f645f61e5ae56 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 12 Apr 2021 20:50:05 -0700 Subject: [PATCH] stats: Convert total message to FormatJS. Signed-off-by: Anders Kaseorg --- static/js/stats/stats.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/static/js/stats/stats.js b/static/js/stats/stats.js index 0cc76e9c8b..21b0289912 100644 --- a/static/js/stats/stats.js +++ b/static/js/stats/stats.js @@ -4,7 +4,7 @@ import Plotly from "plotly.js/lib/core"; import PlotlyPie from "plotly.js/lib/pie"; import tippy from "tippy.js"; -import {i18n} from "../i18n"; +import {$t_html, i18n} from "../i18n"; import {page_params} from "../page_params"; Plotly.register([PlotlyBar, PlotlyPie]); @@ -610,9 +610,10 @@ function populate_messages_sent_by_message_type(data) { colors: ["#68537c", "#be6d68", "#b3b348"], }, }, - total_str: i18n.t("Total messages: __total_messages__", { - total_messages: total_string, - }), + total_html: $t_html( + {defaultMessage: "Total messages: {total_messages}"}, + {total_messages: total_string}, + ), }; } @@ -660,7 +661,7 @@ function populate_messages_sent_by_message_type(data) { layout, {displayModeBar: false}, ); - totaldiv.innerHTML = plot_data[user_button][time_button].total_str; + totaldiv.innerHTML = plot_data[user_button][time_button].total_html; } draw_plot();