mirror of https://github.com/zulip/zulip.git
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:
parent
5aa1205d23
commit
1073adfb08
|
@ -154,16 +154,16 @@ function generate_title(emoji_name, user_ids) {
|
||||||
|
|
||||||
if (user_ids.length === 1) {
|
if (user_ids.length === 1) {
|
||||||
if (current_user_reacted) {
|
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];
|
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) {
|
if (user_ids.length === 2 && current_user_reacted) {
|
||||||
context.other_username = usernames[0];
|
context.other_username = usernames[0];
|
||||||
return i18n.t(
|
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,
|
context,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -172,12 +172,12 @@ function generate_title(emoji_name, user_ids) {
|
||||||
context.last_username = _.last(usernames);
|
context.last_username = _.last(usernames);
|
||||||
if (current_user_reacted) {
|
if (current_user_reacted) {
|
||||||
return i18n.t(
|
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,
|
context,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return i18n.t(
|
return i18n.t(
|
||||||
"__comma_separated_usernames__ and __last_username__ reacted with __emoji_name__",
|
"__- comma_separated_usernames__ and __- last_username__ reacted with __- emoji_name__",
|
||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue