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
This commit is contained in:
Wesley Aptekar-Cassels 2020-11-25 19:11:54 +08:00 committed by Tim Abbott
parent 5aa1205d23
commit 1073adfb08
1 changed files with 5 additions and 5 deletions

View File

@ -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,
);
}