Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
confirm_dialog: Convert heading, yes button messages to FormatJS.
Anders Kaseorg00fb1aaadcce
diff --git a/static/js/avatar.js b/static/js/avatar.jsindex faa82123813..a1542846e04 100644--- a/static/js/avatar.js+++ b/static/js/avatar.js@@ -4,7 +4,7 @@ import render_confirm_delete_user_avatar from "../templates/confirm_delete_user_import * as channel from "./channel";import * as confirm_dialog from "./confirm_dialog";-import {i18n} from "./i18n";+import {$t_html} from "./i18n";import {page_params} from "./page_params";import * as settings_data from "./settings_data";import * as upload_widget from "./upload_widget";@@ -84,9 +84,9 @@ export function build_user_avatar_widget(upload_function) {confirm_dialog.launch({parent: modal_parent,- html_heading: i18n.t("Delete profile picture"),+ html_heading: $t_html({defaultMessage: "Delete profile picture"}),html_body,- html_yes_button: i18n.t("Confirm"),+ html_yes_button: $t_html({defaultMessage: "Confirm"}),on_click: delete_user_avatar,});});diff --git a/static/js/settings_user_groups.js b/static/js/settings_user_groups.jsindex fd84e5dc9c1..0e05e8188af 100644--- a/static/js/settings_user_groups.js+++ b/static/js/settings_user_groups.js@@ -367,9 +367,9 @@ export function set_up() {confirm_dialog.launch({parent: modal_parent,- html_heading: i18n.t("Delete user group"),+ html_heading: $t_html({defaultMessage: "Delete user group"}),html_body,- html_yes_button: i18n.t("Confirm"),+ html_yes_button: $t_html({defaultMessage: "Confirm"}),on_click: delete_user_group,});});diff --git a/static/js/starred_messages_ui.js b/static/js/starred_messages_ui.jsindex 4f8ab70ae14..46fbec004a7 100644--- a/static/js/starred_messages_ui.js+++ b/static/js/starred_messages_ui.js@@ -4,7 +4,7 @@ import render_confirm_unstar_all_messages from "../templates/confirm_unstar_all_import render_confirm_unstar_all_messages_in_topic from "../templates/confirm_unstar_all_messages_in_topic.hbs";import * as confirm_dialog from "./confirm_dialog";-import {i18n} from "./i18n";+import {$t_html} from "./i18n";import * as message_flags from "./message_flags";export function confirm_unstar_all_messages() {@@ -13,9 +13,9 @@ export function confirm_unstar_all_messages() {confirm_dialog.launch({parent: modal_parent,- html_heading: i18n.t("Unstar all messages"),+ html_heading: $t_html({defaultMessage: "Unstar all messages"}),html_body,- html_yes_button: i18n.t("Confirm"),+ html_yes_button: $t_html({defaultMessage: "Confirm"}),on_click: message_flags.unstar_all_messages,});}@@ -32,9 +32,9 @@ export function confirm_unstar_all_messages_in_topic(stream_id, topic) {confirm_dialog.launch({parent: modal_parent,- html_heading: i18n.t("Unstar messages in topic"),+ html_heading: $t_html({defaultMessage: "Unstar messages in topic"}),html_body,- html_yes_button: i18n.t("Confirm"),+ html_yes_button: $t_html({defaultMessage: "Confirm"}),on_click,});}diff --git a/static/js/stream_edit.js b/static/js/stream_edit.jsindex 1e664082dd1..6d2e77be0e9 100644--- a/static/js/stream_edit.js+++ b/static/js/stream_edit.js@@ -833,9 +833,12 @@ export function initialize() {confirm_dialog.launch({parent: modal_parent,- html_heading: i18n.t("Unsubscribe from __stream_name__", {stream_name: sub.name}),+ html_heading: $t_html(+ {defaultMessage: "Unsubscribe from {stream_name}"},+ {stream_name: sub.name},+ ),html_body,- html_yes_button: i18n.t("Yes, unsubscribe from this stream"),+ html_yes_button: $t_html({defaultMessage: "Yes, unsubscribe from this stream"}),on_click: remove_user_from_private_stream,});return;diff --git a/static/js/subs.js b/static/js/subs.jsindex bc3d28178e0..e9730b2cb80 100644--- a/static/js/subs.js+++ b/static/js/subs.js@@ -954,9 +954,12 @@ export function unsubscribe_from_private_stream(sub, from_stream_popover) {confirm_dialog.launch({parent: modal_parent,- html_heading: i18n.t("Unsubscribe from __stream_name__", {stream_name: sub.name}),+ html_heading: $t_html(+ {defaultMessage: "Unsubscribe from {stream_name}"},+ {stream_name: sub.name},+ ),html_body,- html_yes_button: i18n.t("Yes, unsubscribe"),+ html_yes_button: $t_html({defaultMessage: "Yes, unsubscribe"}),on_click: unsubscribe_from_stream,});}