From 1073adfb08239ea1fbc7a41d8620e90ba601b571 Mon Sep 17 00:00:00 2001 From: Wesley Aptekar-Cassels Date: Wed, 25 Nov 2020 19:11:54 +0800 Subject: [PATCH] reactions: Fix double-escaping usernames in tooltip. Appling i18 to reaction tooltips (#16585) caused usernames to be double-escaped, for instance, if there is a single-quote in a username. This disables escaping of usernames by i18next, since they're escaped again later by the rendering code. Fixes: #16785 --- static/js/reactions.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/js/reactions.js b/static/js/reactions.js index d766b47ad7..bf648f1281 100644 --- a/static/js/reactions.js +++ b/static/js/reactions.js @@ -154,16 +154,16 @@ function generate_title(emoji_name, user_ids) { if (user_ids.length === 1) { if (current_user_reacted) { - return i18n.t("You (click to remove) reacted with __emoji_name__", context); + return i18n.t("You (click to remove) reacted with __- emoji_name__", context); } context.username = usernames[0]; - return i18n.t("__username__ reacted with __emoji_name__", context); + return i18n.t("__- username__ reacted with __- emoji_name__", context); } if (user_ids.length === 2 && current_user_reacted) { context.other_username = usernames[0]; return i18n.t( - "You (click to remove) and __other_username__ reacted with __emoji_name__", + "You (click to remove) and __- other_username__ reacted with __- emoji_name__", context, ); } @@ -172,12 +172,12 @@ function generate_title(emoji_name, user_ids) { context.last_username = _.last(usernames); if (current_user_reacted) { return i18n.t( - "You (click to remove), __comma_separated_usernames__ and __last_username__ reacted with __emoji_name__", + "You (click to remove), __- comma_separated_usernames__ and __- last_username__ reacted with __- emoji_name__", context, ); } return i18n.t( - "__comma_separated_usernames__ and __last_username__ reacted with __emoji_name__", + "__- comma_separated_usernames__ and __- last_username__ reacted with __- emoji_name__", context, ); }