i18n: Translate quote and reply mention text.

Fixes #17479
This commit is contained in:
Vishnu KS
2021-03-05 01:13:27 +05:30
committed by Tim Abbott
parent 423770f189
commit def1e01512
2 changed files with 9 additions and 5 deletions

View File

@@ -333,7 +333,8 @@ test("quote_and_reply", (override) => {
sender_full_name: "Steve Stephenson",
sender_id: 90,
};
hash_util.by_conversation_and_time_uri = () => "link_to_message";
hash_util.by_conversation_and_time_uri = () =>
"https://chat.zulip.org/#narrow/stream/92-learning/topic/Tornado";
let success_function;
override(channel, "get", (opts) => {
@@ -356,7 +357,7 @@ test("quote_and_reply", (override) => {
replaced = false;
expected_replacement =
"@_**Steve Stephenson|90** [said](link_to_message):\n```quote\nTesting.\n```";
"translated: @_**Steve Stephenson|90** [said](https://chat.zulip.org/#narrow/stream/92-learning/topic/Tornado):\n```quote\nTesting.\n```";
quote_and_reply(opts);
@@ -395,7 +396,7 @@ test("quote_and_reply", (override) => {
replaced = false;
expected_replacement =
"@_**Steve Stephenson|90** [said](link_to_message):\n````quote\n```\nmultiline code block\nshoudln't mess with quotes\n```\n````";
"translated: @_**Steve Stephenson|90** [said](https://chat.zulip.org/#narrow/stream/92-learning/topic/Tornado):\n````quote\n```\nmultiline code block\nshoudln't mess with quotes\n```\n````";
quote_and_reply(opts);
assert(replaced);
});

View File

@@ -456,8 +456,11 @@ export function quote_and_reply(opts) {
// ```quote
// message content
// ```
let content = `@_**${message.sender_full_name}|${message.sender_id}** `;
content += `[said](${hash_util.by_conversation_and_time_uri(message)}):\n`;
let content = i18n.t("__username__ [said](__- link_to_message__):", {
username: `@_**${message.sender_full_name}|${message.sender_id}**`,
link_to_message: `${hash_util.by_conversation_and_time_uri(message)}`,
});
content += "\n";
const fence = fenced_code.get_unused_fence(message.raw_content);
content += `${fence}quote\n${message.raw_content}\n${fence}`;
compose_ui.replace_syntax("[Quoting…]", content, textarea);