compose: Convert show_preview messages to FormatJS.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-04-13 15:59:25 -07:00
committed by Tim Abbott
parent d761077dac
commit a70061d91f
2 changed files with 7 additions and 4 deletions

View File

@@ -1558,7 +1558,10 @@ test_ui("on_events", (override) => {
function test_post_error(error_callback) {
error_callback();
assert.equal($("#preview_content").html(), "translated: Failed to generate preview");
assert.equal(
$("#preview_content").html(),
"translated HTML: Failed to generate preview",
);
}
function mock_channel_post(msg) {
@@ -1598,7 +1601,7 @@ test_ui("on_events", (override) => {
handler(event);
assert.equal($("#preview_content").html(), "translated: Nothing to preview");
assert.equal($("#preview_content").html(), "translated HTML: Nothing to preview");
assert_visibilities();
let make_indicator_called = false;

View File

@@ -955,7 +955,7 @@ export function render_and_show_preview(preview_spinner, preview_content_box, co
}
if (content.length === 0) {
show_preview(i18n.t("Nothing to preview"));
show_preview($t_html({defaultMessage: "Nothing to preview"}));
} else {
if (markdown.contains_backend_only_syntax(content)) {
const spinner = preview_spinner.expectOne();
@@ -988,7 +988,7 @@ export function render_and_show_preview(preview_spinner, preview_content_box, co
if (markdown.contains_backend_only_syntax(content)) {
loading.destroy_indicator(preview_spinner);
}
show_preview(i18n.t("Failed to generate preview"));
show_preview($t_html({defaultMessage: "Failed to generate preview"}));
},
});
}