mirror of
https://github.com/zulip/zulip.git
synced 2025-11-20 22:48:16 +00:00
Long labels like "Unstar messages" can be confusing for translators and it can also create bad strings that can end with like 4 long words in German. It is better to have the simple options like "Confirm" and "Cancel". This commit fixes this issue by changing such text to "Confirm" as default in confirm_dialog_modal. Part of #17926.
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
import $ from "jquery";
|
|
|
|
import render_confirm_unstar_all_messages from "../templates/confirm_unstar_all_messages.hbs";
|
|
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 * as message_flags from "./message_flags";
|
|
|
|
export function confirm_unstar_all_messages() {
|
|
const modal_parent = $(".left-sidebar-modal-holder");
|
|
const html_body = render_confirm_unstar_all_messages();
|
|
|
|
confirm_dialog.launch({
|
|
parent: modal_parent,
|
|
html_heading: i18n.t("Unstar all messages"),
|
|
html_body,
|
|
html_yes_button: i18n.t("Confirm"),
|
|
on_click: message_flags.unstar_all_messages,
|
|
});
|
|
}
|
|
|
|
export function confirm_unstar_all_messages_in_topic(stream_id, topic) {
|
|
function on_click() {
|
|
message_flags.unstar_all_messages_in_topic(stream_id, topic);
|
|
}
|
|
|
|
const modal_parent = $(".left-sidebar-modal-holder");
|
|
const html_body = render_confirm_unstar_all_messages_in_topic({
|
|
topic,
|
|
});
|
|
|
|
confirm_dialog.launch({
|
|
parent: modal_parent,
|
|
html_heading: i18n.t("Unstar messages in topic"),
|
|
html_body,
|
|
html_yes_button: i18n.t("Confirm"),
|
|
on_click,
|
|
});
|
|
}
|