web: Update strings from "Alert Words" to "Watched Phrases".

This commit migrates user-facing strings and relevant code references
from "Alert Words" to "Watched Phrases".

Fixes part of #28779.
This commit is contained in:
Aditya Kumar Kasaudhan 2024-11-05 17:07:19 +05:30
parent 555c168f01
commit 1ff669c1d4
10 changed files with 21 additions and 21 deletions

View File

@ -319,7 +319,7 @@ async function test_duplicate_alert_words_cannot_be_added(
const alert_word_status_selector = "#dialog_error";
await page.waitForSelector(alert_word_status_selector, {visible: true});
const status_text = await common.get_text_from_selector(page, alert_word_status_selector);
assert.strictEqual(status_text, "Alert word already exists!");
assert.strictEqual(status_text, "Watched phrase already exists!");
await page.click("#add-alert-word .dialog_exit_button");
await common.wait_for_micromodal_to_close(page);
@ -334,7 +334,7 @@ async function delete_alert_word(page: Page, word: string): Promise<void> {
async function test_alert_word_deletion(page: Page, word: string): Promise<void> {
await delete_alert_word(page, word);
const status_text = await get_alert_words_status_text(page);
assert.strictEqual(status_text, `Alert word "${word}" removed successfully!`);
assert.strictEqual(status_text, `Watched phrase "${word}" removed successfully!`);
await close_alert_words_status(page);
}

View File

@ -55,7 +55,7 @@ function add_alert_word(): void {
if (alert_words.has_alert_word(alert_word)) {
ui_report.client_error(
$t({defaultMessage: "Alert word already exists!"}),
$t({defaultMessage: "Watched phrase already exists!"}),
$("#dialog_error"),
);
dialog_widget.hide_dialog_spinner();
@ -76,14 +76,14 @@ function remove_alert_word(alert_word: string): void {
success() {
update_alert_word_status(
$t(
{defaultMessage: `Alert word "{alert_word}" removed successfully!`},
{defaultMessage: `Watched phrase "{alert_word}" removed successfully!`},
{alert_word},
),
false,
);
},
error() {
update_alert_word_status($t({defaultMessage: "Error removing alert word!"}), true);
update_alert_word_status($t({defaultMessage: "Error removing watched phrase!"}), true);
},
});
}
@ -105,7 +105,7 @@ export function show_add_alert_word_modal(): void {
}
dialog_widget.launch({
html_heading: $t_html({defaultMessage: "Add a new alert word"}),
html_heading: $t_html({defaultMessage: "Add a new watched phrase"}),
html_body,
html_submit_button: $t_html({defaultMessage: "Add"}),
help_link: "/help/dm-mention-alert-notifications#alert-words",

View File

@ -689,7 +689,7 @@ function get_is_filter_suggestions(last: NarrowTerm, terms: NarrowTerm[]): Sugge
},
{
search_string: "is:alerted",
description_html: "alerted messages",
description_html: "messages with watched phrases",
is_people: false,
incompatible_patterns: [{operator: "is", operand: "alerted"}],
},

View File

@ -112,7 +112,7 @@
<tr>
<td class="operator">is:alerted</td>
<td class="definition">
{{t 'Narrow to messages with alert words.'}}
{{t 'Narrow to messages with watched phrases.'}}
</td>
</tr>
<tr>

View File

@ -1,4 +1,4 @@
<form id="add-alert-word-form">
<label for="add-alert-word-name" class="modal-field-label">{{t "Alert word" }}</label>
<input type="text" name="alert-word-name" id="add-alert-word-name" class="required modal_text_input" maxlength=100 placeholder="{{t 'Alert word' }}" value="" />
<label for="add-alert-word-name" class="modal-field-label">{{t "Watched phrase" }}</label>
<input type="text" name="alert-word-name" id="add-alert-word-name" class="required modal_text_input" maxlength=100 placeholder="{{t 'Watched phrase' }}" value="" />
</form>

View File

@ -1,15 +1,15 @@
<div id="alert-word-settings" class="settings-section" data-name="alert-words">
<form id="alert_word_info_box">
<p class="alert-word-settings-note">
{{t "Alert words allow you to be notified as if you were @-mentioned when certain words or phrases are used in Zulip. Alert words are not case sensitive."}}
{{t "Watched phrases allow you to be notified as if you were @-mentioned when certain words or phrases are used in Zulip. Watched phrases are not case sensitive."}}
</p>
</form>
<button class="button rounded sea-green" id="open-add-alert-word-modal" type="button">
{{t 'Add alert word'}}
{{t 'Add watched phrase'}}
</button>
<div class="settings_panel_list_header">
<h3>{{t "Alert words"}}</h3>
<h3>{{t "Watched phrases"}}</h3>
</div>
<div class="alert" id="alert_word_status" role="alert">
<button type="button" class="close close-alert-word-status" aria-label="{{t 'Close' }}">
@ -24,7 +24,7 @@
<th class="actions">{{t "Actions" }}</th>
</thead>
<tbody id="alert-words-table" class="alert-words-table"
data-empty="{{t 'There are no current alert words.' }}"></tbody>
data-empty="{{t 'There are no current watched phrases.' }}"></tbody>
</table>
</div>
</div>

View File

@ -1,4 +1,4 @@
{{! Alert word in the settings page that can be removed }}
{{! Watched phrase in the settings page that can be removed }}
{{#with alert_word}}
<tr class="alert-word-item" data-word='{{word}}'>
<td>

View File

@ -36,7 +36,7 @@
{{/unless}}
<li class="sidebar-item" tabindex="0" data-section="alert-words">
<i class="sidebar-item-icon fa fa-book" aria-hidden="true"></i>
<div class="text">{{t "Alert words" }}</div>
<div class="text">{{t "Watched phrases" }}</div>
</li>
{{#if show_uploaded_files_section}}
<li class="sidebar-item" tabindex="0" data-section="uploaded-files">

View File

@ -80,7 +80,7 @@ run_test("remove_alert_word", ({override_rewire}) => {
// test failure
fail_func();
assert.ok($alert_word_status.hasClass("alert-danger"));
assert.equal($alert_word_status_text.text(), "translated: Error removing alert word!");
assert.equal($alert_word_status_text.text(), "translated: Error removing watched phrase!");
assert.ok($alert_word_status.visible());
// test success
@ -88,7 +88,7 @@ run_test("remove_alert_word", ({override_rewire}) => {
assert.ok($alert_word_status.hasClass("alert-success"));
assert.equal(
$alert_word_status_text.text(),
`translated: Alert word "translated: zot" removed successfully!`,
`translated: Watched phrase "translated: zot" removed successfully!`,
);
assert.ok($alert_word_status.visible());
});

View File

@ -394,7 +394,7 @@ test("empty_query_suggestions", () => {
assert.equal(describe("is:dm"), "Direct messages");
assert.equal(describe("is:starred"), "Starred messages");
assert.equal(describe("is:mentioned"), "@-mentions");
assert.equal(describe("is:alerted"), "Alerted messages");
assert.equal(describe("is:alerted"), "Messages with watched phrases");
assert.equal(describe("is:unread"), "Unread messages");
assert.equal(describe("is:resolved"), "Topics marked as resolved");
assert.equal(describe("is:followed"), "Followed topics");
@ -494,7 +494,7 @@ test("check_is_suggestions", ({override, mock_template}) => {
assert.equal(describe("is:dm"), "Direct messages");
assert.equal(describe("is:starred"), "Starred messages");
assert.equal(describe("is:mentioned"), "@-mentions");
assert.equal(describe("is:alerted"), "Alerted messages");
assert.equal(describe("is:alerted"), "Messages with watched phrases");
assert.equal(describe("is:unread"), "Unread messages");
assert.equal(describe("is:resolved"), "Topics marked as resolved");
assert.equal(describe("is:followed"), "Followed topics");
@ -516,7 +516,7 @@ test("check_is_suggestions", ({override, mock_template}) => {
assert.equal(describe("-is:dm"), "Exclude direct messages");
assert.equal(describe("-is:starred"), "Exclude starred messages");
assert.equal(describe("-is:mentioned"), "Exclude @-mentions");
assert.equal(describe("-is:alerted"), "Exclude alerted messages");
assert.equal(describe("-is:alerted"), "Exclude messages with watched phrases");
assert.equal(describe("-is:unread"), "Exclude unread messages");
assert.equal(describe("-is:resolved"), "Exclude topics marked as resolved");
assert.equal(describe("-is:followed"), "Exclude followed topics");