private-messages: Update frontend strings to use "direct message" or "DM".

Updates frontend user-facing strings with "private message" or "PM" to
use "direct message" or "DM" respectively instead.

Note that this updates translated strings as well as a few that
are not translated like search suggestions.

Updates `tools/lib/capitalization.py` for some specific strings
that are impacted by these changes, and removes "PM" and "PMs"
from checked strings.
This commit is contained in:
Lauryn Menard
2023-01-24 19:49:56 +01:00
committed by Tim Abbott
parent 017b05fd84
commit 42775219b3
31 changed files with 95 additions and 95 deletions

View File

@@ -29,8 +29,6 @@ IGNORED_PHRASES = [
r"Markdown",
r"OTP",
r"Pivotal",
r"PM",
r"PMs",
r"DM",
r"DMs",
r"Slack",
@@ -98,9 +96,9 @@ IGNORED_PHRASES = [
r"\bN\b",
# Capital c feels obtrusive in clear status option
r"clear",
r"group private messages with \{recipient\}",
r"private messages with \{recipient\}",
r"private messages with yourself",
r"group direct messages with \{recipient\}",
r"direct messages with \{recipient\}",
r"direct messages with yourself",
r"GIF",
# Emoji name placeholder
r"leafy green vegetable",

View File

@@ -106,7 +106,7 @@ async function test_open_close_compose_box(page: Page): Promise<void> {
async function test_narrow_to_private_messages_with_cordelia(page: Page): Promise<void> {
const you_and_cordelia_selector =
'*[title="Narrow to your private messages with Cordelia, Lear\'s daughter"]';
'*[title="Narrow to your direct messages with Cordelia, Lear\'s daughter"]';
// For some unknown reason page.click() isn't working here.
await page.evaluate(
(selector: string) => document.querySelector<HTMLElement>(selector)!.click(),

View File

@@ -118,7 +118,7 @@ async function test_navigations_from_home(page: Page): Promise<void> {
return; // TODO: rest of this test seems nondeterministically broken
console.log("Narrowing by clicking group personal header");
await page.click(
`#zhome [title="Narrow to your private messages with Cordelia, Lear's daughter, King Hamlet"]`,
`#zhome [title="Narrow to your direct messages with Cordelia, Lear's daughter, King Hamlet"]`,
);
await expect_huddle(page);
@@ -126,7 +126,7 @@ async function test_navigations_from_home(page: Page): Promise<void> {
await expect_home(page);
await page.click(
`#zhome [title="Narrow to your private messages with Cordelia, Lear's daughter, King Hamlet"]`,
`#zhome [title="Narrow to your direct messages with Cordelia, Lear's daughter, King Hamlet"]`,
);
await un_narrow_by_clicking_org_icon(page);
await expect_recent_topics(page);
@@ -199,7 +199,7 @@ async function search_tests(page: Page): Promise<void> {
await search_and_check(
page,
"Cordelia",
"Private",
"Direct",
expect_cordelia_private_narrow,
"Cordelia, Lear's daughter - Zulip Dev - Zulip",
);
@@ -269,7 +269,7 @@ async function expect_all_pm(page: Page): Promise<void> {
await common.get_text_from_selector(page, "#left_bar_compose_stream_button_big"),
"New stream message",
);
assert.strictEqual(await page.title(), "Private messages - Zulip Dev - Zulip");
assert.strictEqual(await page.title(), "Direct messages - Zulip Dev - Zulip");
}
async function test_narrow_by_clicking_the_left_sidebar(page: Page): Promise<void> {

View File

@@ -65,7 +65,7 @@ function update_conversation_button(btn_text, title) {
function update_buttons(text_stream) {
const title_stream = text_stream + " (c)";
const text_conversation = $t({defaultMessage: "New private message"});
const text_conversation = $t({defaultMessage: "New direct message"});
const title_conversation = text_conversation + " (x)";
update_stream_button(text_stream, title_stream);
update_conversation_button(text_conversation, title_conversation);

View File

@@ -501,7 +501,7 @@ function validate_private_message() {
) {
// Unless we're composing to a bot
compose_banner.show_error_message(
$t({defaultMessage: "Private messages are disabled in this organization."}),
$t({defaultMessage: "Direct messages are disabled in this organization."}),
compose_banner.CLASSNAMES.private_messages_disabled,
$("#private_message_recipient"),
);

View File

@@ -703,7 +703,7 @@ export class Filter {
case "is-mentioned":
return $t({defaultMessage: "Mentions"});
case "is-private":
return $t({defaultMessage: "Private messages"});
return $t({defaultMessage: "Direct messages"});
case "is-resolved":
return $t({defaultMessage: "Topics marked as resolved"});
// These cases return false for is_common_narrow, and therefore are not
@@ -981,7 +981,7 @@ export class Filter {
return verb + "sent by";
case "pm-with":
return verb + "private messages with";
return verb + "direct messages with";
case "in":
return verb + "messages in";
@@ -991,7 +991,7 @@ export class Filter {
return verb + "messages that are";
case "group-pm-with":
return verb + "group private messages including";
return verb + "group direct messages including";
}
return "";
}
@@ -999,11 +999,13 @@ export class Filter {
static describe_is_operator(operator) {
const verb = operator.negated ? "exclude " : "";
const operand = operator.operand;
const operand_list = ["private", "starred", "alerted", "unread"];
const operand_list = ["starred", "alerted", "unread"];
if (operand_list.includes(operand)) {
return verb + operand + " messages";
} else if (operand === "mentioned") {
return verb + "@-mentions";
} else if (operand === "private") {
return verb + "direct messages";
}
return "invalid " + operand + " operand for is operator";
}

View File

@@ -194,12 +194,12 @@ function pick_empty_narrow_banner() {
return {
title: $t({
defaultMessage:
"You are not allowed to send private messages in this organization.",
"You are not allowed to send direct messages in this organization.",
}),
};
}
return {
title: $t({defaultMessage: "You have no private messages yet!"}),
title: $t({defaultMessage: "You have no direct messages yet!"}),
html: $t_html(
{
defaultMessage: "Why not <z-link>start the conversation</z-link>?",
@@ -301,7 +301,7 @@ function pick_empty_narrow_banner() {
return {
title: $t({
defaultMessage:
"You are not allowed to send private messages in this organization.",
"You are not allowed to send direct messages in this organization.",
}),
};
}
@@ -311,7 +311,7 @@ function pick_empty_narrow_banner() {
return {
title: $t({
defaultMessage:
"You have not sent any private messages to yourself yet!",
"You have not sent any direct messages to yourself yet!",
}),
html: $t_html(
{
@@ -330,7 +330,7 @@ function pick_empty_narrow_banner() {
return {
title: $t(
{
defaultMessage: "You have no private messages with {person} yet.",
defaultMessage: "You have no direct messages with {person} yet.",
},
{person: people.get_by_user_id(user_ids[0]).full_name},
),
@@ -348,7 +348,7 @@ function pick_empty_narrow_banner() {
};
}
return {
title: $t({defaultMessage: "You have no private messages with these users yet."}),
title: $t({defaultMessage: "You have no direct messages with these users yet."}),
html: $t_html(
{
defaultMessage: "Why not <z-link>start the conversation</z-link>?",
@@ -393,14 +393,14 @@ function pick_empty_narrow_banner() {
return {
title: $t({
defaultMessage:
"You are not allowed to send group private messages in this organization.",
"You are not allowed to send group direct messages in this organization.",
}),
};
}
return {
title: $t(
{
defaultMessage: "You have no group private messages with {person} yet.",
defaultMessage: "You have no group direct messages with {person} yet.",
},
{person: person_in_group_pm.full_name},
),

View File

@@ -253,7 +253,7 @@ export function process_notification(notification) {
user_settings.pm_content_in_desktop_notifications !== undefined &&
!user_settings.pm_content_in_desktop_notifications
) {
content = "New private message from " + message.sender_full_name;
content = "New direct message from " + message.sender_full_name;
}
key = message.display_reply_to;
// Remove the sender from the list of other recipients
@@ -535,15 +535,15 @@ function get_message_header(message) {
}
if (message.display_recipient.length > 2) {
return $t(
{defaultMessage: "group private messages with {recipient}"},
{defaultMessage: "group direct messages with {recipient}"},
{recipient: message.display_reply_to},
);
}
if (people.is_current_user(message.reply_to)) {
return $t({defaultMessage: "private messages with yourself"});
return $t({defaultMessage: "direct messages with yourself"});
}
return $t(
{defaultMessage: "private messages with {recipient}"},
{defaultMessage: "direct messages with {recipient}"},
{recipient: message.display_reply_to},
);
}

View File

@@ -506,7 +506,7 @@ function get_is_filter_suggestions(last, operators) {
const suggestions = [
{
search_string: "is:private",
description_html: "private messages",
description_html: "direct messages",
invalid: [
{operator: "is", operand: "private"},
{operator: "stream"},

View File

@@ -52,7 +52,7 @@ function setup_settings_label() {
defaultMessage: "Let subscribers see when I'm typing messages in streams",
}),
send_private_typing_notifications: $t({
defaultMessage: "Let recipients see when I'm typing private messages",
defaultMessage: "Let recipients see when I'm typing direct messages",
}),
send_read_receipts: $t({
defaultMessage: "Let others see when I've read messages",

View File

@@ -201,7 +201,7 @@ export const private_message_policy_values = {
disabled: {
order: 2,
code: 2,
description: $t({defaultMessage: "Private messages disabled"}),
description: $t({defaultMessage: "Direct messages disabled"}),
},
};
@@ -526,7 +526,7 @@ export const notification_settings_labels = {
defaultMessage: "Send mobile notifications even if I'm online",
}),
pm_content_in_desktop_notifications: $t({
defaultMessage: "Include content of private messages in desktop notifications",
defaultMessage: "Include content of direct messages in desktop notifications",
}),
desktop_icon_count_display: $t({
defaultMessage: "Unread count badge (appears in desktop sidebar and browser tab)",
@@ -768,7 +768,7 @@ export const all_notifications = (settings_object: Settings): AllNotifications =
),
},
{
label: $t({defaultMessage: "PMs, mentions, and alerts"}),
label: $t({defaultMessage: "DMs, mentions, and alerts"}),
notification_settings: get_notifications_table_row_data(
pm_mention_notification_settings,
settings_object,
@@ -794,7 +794,7 @@ export const desktop_icon_count_display_values = {
},
notifiable: {
code: 2,
description: $t({defaultMessage: "Private messages and mentions"}),
description: $t({defaultMessage: "Direct messages and mentions"}),
},
none: {
code: 3,

View File

@@ -266,7 +266,7 @@ export function initialize() {
compose_state.get_message_type() === "private"
) {
display_current_view = $t({
defaultMessage: "Currently viewing all private messages.",
defaultMessage: "Currently viewing all direct messages.",
});
}
}
@@ -435,11 +435,11 @@ export function initialize() {
if ($("#toggle_private_messages_section_icon").hasClass("fa-caret-down")) {
instance.setContent(
$t({
defaultMessage: "Collapse private messages",
defaultMessage: "Collapse direct messages",
}),
);
} else {
instance.setContent($t({defaultMessage: "Expand private messages"}));
instance.setContent($t({defaultMessage: "Expand direct messages"}));
}
return true;
},
@@ -451,7 +451,7 @@ export function initialize() {
target: "#show_all_private_messages",
placement: "bottom",
content: $t({
defaultMessage: "All private messages (P)",
defaultMessage: "All direct messages (P)",
}),
appendTo: () => document.body,
});

View File

@@ -41,8 +41,8 @@
<span class="new_message_button private_button_container">
<button type="button" class="button small rounded compose_private_button"
id="left_bar_compose_private_button_big"
title="{{t 'New private message' }} (x)">
<span class="compose_private_button_label">{{t 'New private message' }}</span>
title="{{t 'New direct message' }} (x)">
<span class="compose_private_button_label">{{t 'New direct message' }}</span>
</button>
</span>
{{/unless}}

View File

@@ -17,7 +17,7 @@
<td><span class="hotkey"><kbd>C</kbd></span></td>
</tr>
<tr>
<td class="definition">{{t 'New private message' }}</td>
<td class="definition">{{t 'New direct message' }}</td>
<td><span class="hotkey"><kbd>X</kbd></span></td>
</tr>
<tr>
@@ -41,7 +41,7 @@
<td><span class="hotkey"><kbd>N</kbd></span></td>
</tr>
<tr>
<td class="definition">{{t 'Next unread private message' }}</td>
<td class="definition">{{t 'Next unread direct message' }}</td>
<td><span class="hotkey"><kbd>P</kbd></span></td>
</tr>
<tr>
@@ -135,7 +135,7 @@
<td><span class="hotkey"><kbd>C</kbd></span></td>
</tr>
<tr>
<td class="definition">{{t 'New private message' }}</td>
<td class="definition">{{t 'New direct message' }}</td>
<td><span class="hotkey"><kbd>X</kbd></span></td>
</tr>
<tr>
@@ -168,11 +168,11 @@
<td><span class="hotkey"><kbd>S</kbd></span></td>
</tr>
<tr>
<td class="definition">{{t 'Narrow to topic or PM conversation' }}</td>
<td class="definition">{{t 'Narrow to topic or DM conversation' }}</td>
<td><span class="hotkey"><kbd>Shift</kbd> + <kbd>S</kbd></span></td>
</tr>
<tr>
<td class="definition">{{t 'Narrow to all private messages' }}</td>
<td class="definition">{{t 'Narrow to all direct messages' }}</td>
<td><span class="hotkey"><kbd>Shift</kbd> + <kbd>P</kbd></span></td>
</tr>
<tr>
@@ -184,7 +184,7 @@
<td><span class="hotkey"><kbd>N</kbd></span></td>
</tr>
<tr>
<td class="definition">{{t 'Narrow to next unread private message' }}</td>
<td class="definition">{{t 'Narrow to next unread direct message' }}</td>
<td><span class="hotkey"><kbd>P</kbd></span></td>
</tr>
<tr>

View File

@@ -62,11 +62,11 @@
<div id="private_messages_section_header" class="zoom-out zoom-in-sticky">
<span id="pm_tooltip_container">
<i id="toggle_private_messages_section_icon" class="fa fa-sm fa-caret-down toggle_private_messages_section zoom-in-hide" aria-hidden="true"></i>
<h4 class="sidebar-title toggle_private_messages_section">{{t 'PRIVATE MESSAGES' }}</h4>
<h4 class="sidebar-title toggle_private_messages_section">{{t 'DIRECT MESSAGES' }}</h4>
</span>
<span class="unread_count"></span>
<a id="show_all_private_messages" href="#narrow/is/private">
<i class="fa fa-align-right" aria-label="{{t 'All private messages' }}"></i>
<i class="fa fa-align-right" aria-label="{{t 'All direct messages' }}"></i>
</a>
</div>
</div>

View File

@@ -13,9 +13,9 @@
<a class="compose_mobile_private_button">
<i class="fa fa-envelope" aria-hidden="true"></i>
{{#if is_in_private_narrow }}
{{t "New private message" }}
{{t "New direct message" }}
{{else}}
{{t "New private message" }}
{{t "New direct message" }}
{{/if}}
</a>
</li>

View File

@@ -4,7 +4,7 @@
<div class="left_part recent_topics_focusable">
{{#if is_private}}
<span class="fa fa-envelope"></span>
<a href="{{pm_url}}">Private messages</a>
<a href="{{pm_url}}">Direct messages</a>
{{else}}
<span id="stream_sidebar_privacy_swatch_{{stream_id}}" class="stream-privacy filter-icon" style="color: {{stream_color}}">
{{> stream_privacy }}

View File

@@ -5,7 +5,7 @@
{{else}}
<i class="fa fa-square-o"></i>
{{/if}}
{{t 'Include PMs' }}
{{t 'Include DMs' }}
</button>
<button data-filter="include_muted" type="button" class="btn btn-default btn-recent-filters {{#if is_spectator}}fake_disabled_button{{/if}}" role="checkbox" aria-checked="false">
{{#if filter_muted }}

View File

@@ -87,7 +87,7 @@
<div class="message-header-contents">
<a class="message_label_clickable narrows_by_recipient stream_label"
href="{{pm_with_url}}"
title="{{#tr}}Narrow to your private messages with {display_reply_to}{{/tr}}">
title="{{#tr}}Narrow to your direct messages with {display_reply_to}{{/tr}}">
{{#tr}}You and {display_reply_to}{{/tr}}
</a>

View File

@@ -39,14 +39,14 @@
<tr>
<td class="operator">is:private</td>
<td class="definition">
{{t 'Narrow to private messages.'}}
{{t 'Narrow to direct messages.'}}
</td>
</tr>
<tr>
<td class="operator">pm-with:<span class="operator_value">user</span></td>
<td class="definition">
{{#tr}}
Narrow to private messages with <z-value></z-value>.
Narrow to direct messages with <z-value></z-value>.
{{#*inline "z-value"}}<span class="operator_value">user</span>{{/inline}}
{{/tr}}
</td>
@@ -55,7 +55,7 @@
<td class="operator">group-pm-with:<span class="operator_value">user</span></td>
<td class="definition">
{{#tr}}
Narrow to group private messages with <z-value></z-value>.
Narrow to group direct messages with <z-value></z-value>.
{{#*inline "z-value"}}<span class="operator_value">user</span>{{/inline}}
{{/tr}}
</td>

View File

@@ -304,7 +304,7 @@
</div>
<div class="input-group">
<label for="realm_private_message_policy">{{t "Who can use private messages" }} ({{t "beta" }})
<label for="realm_private_message_policy">{{t "Who can use direct messages" }} ({{t "beta" }})
{{> ../help_link_widget link="/help/restrict-private-messages" }}
</label>
<select name="realm_private_message_policy" class="setting-widget prop-element settings_select bootstrap-focus-style" id="id_realm_private_message_policy" data-setting-widget-type="number">

View File

@@ -124,7 +124,7 @@
{{#if can_send_private_message}}
<li>
<a tabindex="0" class="{{ private_message_class }}">
<i class="fa fa-comment" aria-hidden="true"></i> {{#tr}}Send private message{{/tr}} {{#if is_sender_popover}}<span class="hotkey-hint">(R)</span>{{/if}}
<i class="fa fa-comment" aria-hidden="true"></i> {{#tr}}Send direct message{{/tr}} {{#if is_sender_popover}}<span class="hotkey-hint">(R)</span>{{/if}}
</a>
</li>
{{/if}}
@@ -159,7 +159,7 @@
{{#if is_me}}
{{#tr}}View messages with yourself{{/tr}}
{{else}}
{{#tr}}View private messages{{/tr}}
{{#tr}}View direct messages{{/tr}}
{{/if}}
</a>
</li>

View File

@@ -771,7 +771,7 @@ test_ui("narrow_button_titles", () => {
);
assert.equal(
$("#left_bar_compose_private_button_big").text(),
$t({defaultMessage: "New private message"}),
$t({defaultMessage: "New direct message"}),
);
compose_closed_ui.update_buttons_for_stream();
@@ -781,7 +781,7 @@ test_ui("narrow_button_titles", () => {
);
assert.equal(
$("#left_bar_compose_private_button_big").text(),
$t({defaultMessage: "New private message"}),
$t({defaultMessage: "New direct message"}),
);
});

View File

@@ -1138,7 +1138,7 @@ test("describe", () => {
{operator: "is", operand: "private"},
{operator: "search", operand: "lunch"},
];
string = "private messages, search for lunch";
string = "direct messages, search for lunch";
assert.equal(Filter.describe(narrow), string);
narrow = [{operator: "id", operand: 99}];
@@ -1177,7 +1177,7 @@ test("describe", () => {
{operator: "is", operand: "private"},
{operator: "search", operand: "lunch", negated: true},
];
string = "private messages, exclude lunch";
string = "direct messages, exclude lunch";
assert.equal(Filter.describe(narrow), string);
narrow = [
@@ -1517,7 +1517,7 @@ test("navbar_helpers", () => {
operator: is_private,
is_common_narrow: true,
icon: "envelope",
title: "translated: Private messages",
title: "translated: Direct messages",
redirect_url_with_search: "/#narrow/is/private",
},
{

View File

@@ -317,7 +317,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You are not allowed to send private messages in this organization.",
"translated: You are not allowed to send direct messages in this organization.",
),
);
@@ -330,7 +330,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You have no private messages yet!",
"translated: You have no direct messages yet!",
'translated HTML: Why not <a href="#" class="empty_feed_compose_private">start the conversation</a>?',
),
);
@@ -379,7 +379,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You are not allowed to send private messages in this organization.",
"translated: You are not allowed to send direct messages in this organization.",
),
);
@@ -392,7 +392,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You have no private messages with Example Bot yet.",
"translated: You have no direct messages with Example Bot yet.",
'translated HTML: Why not <a href="#" class="empty_feed_compose_private">start the conversation</a>?',
),
);
@@ -405,7 +405,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You are not allowed to send private messages in this organization.",
"translated: You are not allowed to send direct messages in this organization.",
),
);
@@ -418,7 +418,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You have no private messages with Alice Smith yet.",
"translated: You have no direct messages with Alice Smith yet.",
'translated HTML: Why not <a href="#" class="empty_feed_compose_private">start the conversation</a>?',
),
);
@@ -431,7 +431,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You have not sent any private messages to yourself yet!",
"translated: You have not sent any direct messages to yourself yet!",
'translated HTML: Why not <a href="#" class="empty_feed_compose_private">start a conversation with yourself</a>?',
),
);
@@ -442,7 +442,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You have no private messages with these users yet.",
"translated: You have no direct messages with these users yet.",
'translated HTML: Why not <a href="#" class="empty_feed_compose_private">start the conversation</a>?',
),
);
@@ -466,7 +466,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You are not allowed to send group private messages in this organization.",
"translated: You are not allowed to send group direct messages in this organization.",
),
);
@@ -478,7 +478,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You are not allowed to send group private messages in this organization.",
"translated: You are not allowed to send group direct messages in this organization.",
),
);
@@ -491,7 +491,7 @@ run_test("show_empty_narrow_message", ({mock_template}) => {
assert.equal(
$(".empty_feed_notice_main").html(),
empty_narrow_html(
"translated: You have no group private messages with Alice Smith yet.",
"translated: You have no group direct messages with Alice Smith yet.",
'translated HTML: Why not <a href="#" class="empty_feed_compose_private">start the conversation</a>?',
),
);

View File

@@ -154,7 +154,7 @@ test("initialize", ({mock_template}) => {
[
"group-pm-with:zo",
{
description_html: "group private messages including",
description_html: "group direct messages including",
is_person: true,
search_string: "group-pm-with:user7@zulipdev.com",
user_pill_context: {
@@ -169,7 +169,7 @@ test("initialize", ({mock_template}) => {
[
"pm-with:zo",
{
description_html: "private messages with",
description_html: "direct messages with",
is_person: true,
search_string: "pm-with:user7@zulipdev.com",
user_pill_context: {
@@ -220,10 +220,10 @@ test("initialize", ({mock_template}) => {
expected_value = `<div class="search_list_item">\n <span>sent by</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d&#x3D;identicon&amp;version&#x3D;1&amp;s&#x3D;50" />\n <span class="pill-value">&lt;strong&gt;Zo&lt;/strong&gt;e</span>\n <div class="exit">\n <span aria-hidden="true">&times;</span>\n </div>\n</div>\n </span>\n</div>\n`;
assert.equal(opts.highlighter(source[1]), expected_value);
expected_value = `<div class="search_list_item">\n <span>private messages with</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d&#x3D;identicon&amp;version&#x3D;1&amp;s&#x3D;50" />\n <span class="pill-value">&lt;strong&gt;Zo&lt;/strong&gt;e</span>\n <div class="exit">\n <span aria-hidden="true">&times;</span>\n </div>\n</div>\n </span>\n</div>\n`;
expected_value = `<div class="search_list_item">\n <span>direct messages with</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d&#x3D;identicon&amp;version&#x3D;1&amp;s&#x3D;50" />\n <span class="pill-value">&lt;strong&gt;Zo&lt;/strong&gt;e</span>\n <div class="exit">\n <span aria-hidden="true">&times;</span>\n </div>\n</div>\n </span>\n</div>\n`;
assert.equal(opts.highlighter(source[2]), expected_value);
expected_value = `<div class="search_list_item">\n <span>group private messages including</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d&#x3D;identicon&amp;version&#x3D;1&amp;s&#x3D;50" />\n <span class="pill-value">&lt;strong&gt;Zo&lt;/strong&gt;e</span>\n <div class="exit">\n <span aria-hidden="true">&times;</span>\n </div>\n</div>\n </span>\n</div>\n`;
expected_value = `<div class="search_list_item">\n <span>group direct messages including</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d&#x3D;identicon&amp;version&#x3D;1&amp;s&#x3D;50" />\n <span class="pill-value">&lt;strong&gt;Zo&lt;/strong&gt;e</span>\n <div class="exit">\n <span aria-hidden="true">&times;</span>\n </div>\n</div>\n </span>\n</div>\n`;
assert.equal(opts.highlighter(source[3]), expected_value);
/* Test sorter */

View File

@@ -136,7 +136,7 @@ run_test("initialize", ({mock_template}) => {
[
"group-pm-with:zo",
{
description_html: "group private messages including",
description_html: "group direct messages including",
is_person: true,
search_string: "group-pm-with:user7@zulipdev.com",
user_pill_context: {
@@ -151,7 +151,7 @@ run_test("initialize", ({mock_template}) => {
[
"pm-with:zo",
{
description_html: "private messages with",
description_html: "direct messages with",
is_person: true,
search_string: "pm-with:user7@zulipdev.com",
user_pill_context: {
@@ -202,10 +202,10 @@ run_test("initialize", ({mock_template}) => {
expected_value = `<div class="search_list_item">\n <span>sent by</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d&#x3D;identicon&amp;version&#x3D;1&amp;s&#x3D;50" />\n <span class="pill-value">&lt;strong&gt;Zo&lt;/strong&gt;e</span>\n <div class="exit">\n <span aria-hidden="true">&times;</span>\n </div>\n</div>\n </span>\n</div>\n`;
assert.equal(opts.highlighter(source[1]), expected_value);
expected_value = `<div class="search_list_item">\n <span>private messages with</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d&#x3D;identicon&amp;version&#x3D;1&amp;s&#x3D;50" />\n <span class="pill-value">&lt;strong&gt;Zo&lt;/strong&gt;e</span>\n <div class="exit">\n <span aria-hidden="true">&times;</span>\n </div>\n</div>\n </span>\n</div>\n`;
expected_value = `<div class="search_list_item">\n <span>direct messages with</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d&#x3D;identicon&amp;version&#x3D;1&amp;s&#x3D;50" />\n <span class="pill-value">&lt;strong&gt;Zo&lt;/strong&gt;e</span>\n <div class="exit">\n <span aria-hidden="true">&times;</span>\n </div>\n</div>\n </span>\n</div>\n`;
assert.equal(opts.highlighter(source[2]), expected_value);
expected_value = `<div class="search_list_item">\n <span>group private messages including</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d&#x3D;identicon&amp;version&#x3D;1&amp;s&#x3D;50" />\n <span class="pill-value">&lt;strong&gt;Zo&lt;/strong&gt;e</span>\n <div class="exit">\n <span aria-hidden="true">&times;</span>\n </div>\n</div>\n </span>\n</div>\n`;
expected_value = `<div class="search_list_item">\n <span>group direct messages including</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d&#x3D;identicon&amp;version&#x3D;1&amp;s&#x3D;50" />\n <span class="pill-value">&lt;strong&gt;Zo&lt;/strong&gt;e</span>\n <div class="exit">\n <span aria-hidden="true">&times;</span>\n </div>\n</div>\n </span>\n</div>\n`;
assert.equal(opts.highlighter(source[3]), expected_value);
/* Test sorter */

View File

@@ -16,7 +16,7 @@ const is_starred_item = {
const is_private_item = {
display_value: "is:private",
description_html: "private messages",
description_html: "direct messages",
};
run_test("create_item", () => {

View File

@@ -388,7 +388,7 @@ test("empty_query_suggestions", () => {
function describe(q) {
return suggestions.lookup_table.get(q).description_html;
}
assert.equal(describe("is:private"), "Private messages");
assert.equal(describe("is:private"), "Direct messages");
assert.equal(describe("is:starred"), "Starred messages");
assert.equal(describe("is:mentioned"), "@-mentions");
assert.equal(describe("is:alerted"), "Alerted messages");
@@ -483,7 +483,7 @@ test("check_is_suggestions", ({override}) => {
return suggestions.lookup_table.get(q).description_html;
}
assert.equal(describe("is:private"), "Private messages");
assert.equal(describe("is:private"), "Direct messages");
assert.equal(describe("is:starred"), "Starred messages");
assert.equal(describe("is:mentioned"), "@-mentions");
assert.equal(describe("is:alerted"), "Alerted messages");
@@ -503,7 +503,7 @@ test("check_is_suggestions", ({override}) => {
];
assert.deepEqual(suggestions.strings, expected);
assert.equal(describe("-is:private"), "Exclude private messages");
assert.equal(describe("-is:private"), "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");
@@ -870,9 +870,9 @@ test("people_suggestions", ({override}) => {
assert.equal(has_image("group-pm-with:bob@zulip.com"), true);
const describe = (q) => suggestions.lookup_table.get(q).description_html;
assert.equal(describe("pm-with:ted@zulip.com"), "Private messages with");
assert.equal(describe("pm-with:ted@zulip.com"), "Direct messages with");
assert.equal(describe("sender:ted@zulip.com"), "Sent by");
assert.equal(describe("group-pm-with:ted@zulip.com"), "Group private messages including");
assert.equal(describe("group-pm-with:ted@zulip.com"), "Group direct messages including");
let expectedString = "<strong>Te</strong>d Smith";

View File

@@ -393,7 +393,7 @@ test("empty_query_suggestions", () => {
function describe(q) {
return suggestions.lookup_table.get(q).description_html;
}
assert.equal(describe("is:private"), "Private messages");
assert.equal(describe("is:private"), "Direct messages");
assert.equal(describe("is:starred"), "Starred messages");
assert.equal(describe("is:mentioned"), "@-mentions");
assert.equal(describe("is:alerted"), "Alerted messages");
@@ -491,7 +491,7 @@ test("check_is_suggestions", ({override}) => {
return suggestions.lookup_table.get(q).description_html;
}
assert.equal(describe("is:private"), "Private messages");
assert.equal(describe("is:private"), "Direct messages");
assert.equal(describe("is:starred"), "Starred messages");
assert.equal(describe("is:mentioned"), "@-mentions");
assert.equal(describe("is:alerted"), "Alerted messages");
@@ -511,7 +511,7 @@ test("check_is_suggestions", ({override}) => {
];
assert.deepEqual(suggestions.strings, expected);
assert.equal(describe("-is:private"), "Exclude private messages");
assert.equal(describe("-is:private"), "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");
@@ -847,9 +847,9 @@ test("people_suggestions", ({override}) => {
function describe(q) {
return suggestions.lookup_table.get(q).description_html;
}
assert.equal(describe("pm-with:ted@zulip.com"), "Private messages with");
assert.equal(describe("pm-with:ted@zulip.com"), "Direct messages with");
assert.equal(describe("sender:ted@zulip.com"), "Sent by");
assert.equal(describe("group-pm-with:ted@zulip.com"), "Group private messages including");
assert.equal(describe("group-pm-with:ted@zulip.com"), "Group direct messages including");
let expectedString = "<strong>Te</strong>d Smith";

View File

@@ -68,7 +68,7 @@ run_test("all_notifications", () => {
],
},
{
label: "translated: PMs, mentions, and alerts",
label: "translated: DMs, mentions, and alerts",
notification_settings: [
{
is_checked: false,