From d7f9f8333ede764615bc00844aed9f2ed85ff3a7 Mon Sep 17 00:00:00 2001 From: Lauryn Menard Date: Thu, 18 Apr 2024 18:36:57 +0200 Subject: [PATCH] web-stream-settings: Update strings for stream rename channel. Updates a chunk of translated strings that overlap between files, with the streams settings overlay being the starting point for finding these strings, to use channel instead of stream. Part of stream to channel rename project. --- tools/lib/capitalization.py | 2 +- web/e2e-tests/stream_create.test.ts | 2 +- web/src/add_stream_options_popover.ts | 8 ++++---- web/src/compose_recipient.ts | 4 ++-- web/src/compose_validate.ts | 8 ++++---- web/src/gear_menu.js | 2 +- web/src/settings_config.ts | 18 ++++++++--------- web/src/stream_popover.js | 2 +- web/src/stream_settings_components.js | 10 ++++++---- web/src/stream_settings_ui.js | 6 +++--- web/src/user_profile.js | 14 ++++++------- web/src/user_topics_ui.js | 2 +- web/styles/compose.css | 2 +- web/styles/left_sidebar.css | 2 +- .../stream_wildcard_warning.hbs | 2 +- web/templates/gear_menu_popover.hbs | 2 +- web/templates/keyboard_shortcuts.hbs | 20 +++++++++---------- web/templates/left_sidebar.hbs | 12 +++++------ .../left_sidebar_stream_setting_popover.hbs | 4 ++-- .../mobile_message_buttons_popover.hbs | 2 +- web/templates/settings/bot_avatar_row.hbs | 2 +- .../settings/default_streams_list_admin.hbs | 10 +++++----- web/templates/settings_overlay.hbs | 2 +- .../stream_settings_overlay.hbs | 18 ++++++++--------- web/templates/stream_sidebar_actions.hbs | 10 +++++----- web/templates/subscribe_to_more_streams.hbs | 6 +++--- web/templates/tooltip_templates.hbs | 10 +++++----- web/templates/user_profile_modal.hbs | 8 ++++---- web/tests/compose_validate.test.js | 8 ++++---- web/tests/i18n.test.js | 2 +- web/tests/settings_config.test.js | 2 +- 31 files changed, 102 insertions(+), 100 deletions(-) diff --git a/tools/lib/capitalization.py b/tools/lib/capitalization.py index c130abe26b..fcb0c6548d 100644 --- a/tools/lib/capitalization.py +++ b/tools/lib/capitalization.py @@ -96,7 +96,7 @@ IGNORED_PHRASES = [ r"^deprecated$", # We want the similar text in the Private Messages section to have the same capitalization. r"more conversations", - r"back to streams", + r"back to channels", # Capital 'i' looks weird in reminders popover r"in 1 hour", r"in 20 minutes", diff --git a/web/e2e-tests/stream_create.test.ts b/web/e2e-tests/stream_create.test.ts index e3ad444dba..d8f835d489 100644 --- a/web/e2e-tests/stream_create.test.ts +++ b/web/e2e-tests/stream_create.test.ts @@ -75,7 +75,7 @@ async function test_user_filter_ui(page: Page): Promise { } async function create_stream(page: Page): Promise { - await page.waitForSelector('xpath///*[text()="Create stream"]', {visible: true}); + await page.waitForSelector('xpath///*[text()="Create channel"]', {visible: true}); await common.fill_form(page, "form#stream_creation_form", { stream_name: "Puppeteer", stream_description: "Everything Puppeteer", diff --git a/web/src/add_stream_options_popover.ts b/web/src/add_stream_options_popover.ts index ca5bc0a580..11f7c4496d 100644 --- a/web/src/add_stream_options_popover.ts +++ b/web/src/add_stream_options_popover.ts @@ -31,8 +31,8 @@ export function initialize(): void { popover_menus.on_show_prep(instance); // When showing the popover menu, we want the - // "Add streams" and the "Filter streams" tooltip - // to appear below the "Add streams" icon. + // "Add channels" and the "Filter channels" tooltip + // to appear below the "Add channels" icon. const add_streams_tooltip: ReferenceElement | undefined = $("#add_streams_tooltip").get(0); assert(add_streams_tooltip !== undefined); @@ -55,9 +55,9 @@ export function initialize(): void { instance.destroy(); popover_menus.popover_instances.stream_settings = null; // After the popover menu is closed, we want the - // "Add streams" and the "Filter streams" tooltip + // "Add channels" and the "Filter channels" tooltip // to appear at it's original position that is - // above the "Add streams" icon. + // above the "Add channels" icon. const add_streams_tooltip: ReferenceElement | undefined = $("#add_streams_tooltip").get(0); assert(add_streams_tooltip !== undefined); diff --git a/web/src/compose_recipient.ts b/web/src/compose_recipient.ts index 02adddd7e6..3477dd7486 100644 --- a/web/src/compose_recipient.ts +++ b/web/src/compose_recipient.ts @@ -131,7 +131,7 @@ export function get_posting_policy_error_message(): string { const stream = sub_store.get(compose_state.selected_recipient_id); if (stream && !stream_data.can_post_messages_in_stream(stream)) { return $t({ - defaultMessage: "You do not have permission to post in this stream.", + defaultMessage: "You do not have permission to post in this channel.", }); } return ""; @@ -174,7 +174,7 @@ function update_recipient_label(stream_id?: number): void { const stream = stream_id !== undefined ? stream_data.get_sub_by_id(stream_id) : undefined; if (stream === undefined) { $("#compose_select_recipient_widget .dropdown_widget_value").text( - $t({defaultMessage: "Select a stream"}), + $t({defaultMessage: "Select a channel"}), ); } else { $("#compose_select_recipient_widget .dropdown_widget_value").html( diff --git a/web/src/compose_validate.ts b/web/src/compose_validate.ts index ebb279da34..52222a0708 100644 --- a/web/src/compose_validate.ts +++ b/web/src/compose_validate.ts @@ -343,8 +343,8 @@ function show_stream_wildcard_warnings(opts: StreamWildcardOptions): void { const stream_wildcard_html = render_stream_wildcard_warning({ banner_type: compose_banner.WARNING, subscriber_count, - stream_name, - stream_wildcard_mention: opts.stream_wildcard_mention, + channel_name: stream_name, + wildcard_mention: opts.stream_wildcard_mention, button_text, hide_close_button: true, classname, @@ -553,7 +553,7 @@ function validate_stream_message(scheduling_message: boolean): boolean { const $banner_container = $("#compose_banners"); if (stream_id === undefined) { compose_banner.show_error_message( - $t({defaultMessage: "Please specify a stream."}), + $t({defaultMessage: "Please specify a channel."}), compose_banner.CLASSNAMES.missing_stream, $banner_container, $("#compose_select_recipient_widget_wrapper"), @@ -585,7 +585,7 @@ function validate_stream_message(scheduling_message: boolean): boolean { if (!stream_data.can_post_messages_in_stream(sub)) { compose_banner.show_error_message( $t({ - defaultMessage: "You do not have permission to post in this stream.", + defaultMessage: "You do not have permission to post in this channel.", }), compose_banner.CLASSNAMES.no_post_permissions, $banner_container, diff --git a/web/src/gear_menu.js b/web/src/gear_menu.js index a4d1478ce1..0f1aecd0af 100644 --- a/web/src/gear_menu.js +++ b/web/src/gear_menu.js @@ -25,7 +25,7 @@ actually do much of the work. Our gear menu has these choices: ================= -hash: Stream settings +hash: Channel settings hash: Settings hash: Organization settings link: Usage statistics diff --git a/web/src/settings_config.ts b/web/src/settings_config.ts index 31a6c3a608..1658cae4b0 100644 --- a/web/src/settings_config.ts +++ b/web/src/settings_config.ts @@ -76,15 +76,15 @@ export const user_list_style_values = { export const web_stream_unreads_count_display_policy_values = { all_streams: { code: 1, - description: $t({defaultMessage: "All streams"}), + description: $t({defaultMessage: "All channels"}), }, unmuted_streams: { code: 2, - description: $t({defaultMessage: "Unmuted streams and topics"}), + description: $t({defaultMessage: "Unmuted channels and topics"}), }, no_streams: { code: 3, - description: $t({defaultMessage: "No streams"}), + description: $t({defaultMessage: "No channels"}), }, }; @@ -585,7 +585,7 @@ export const notification_settings_labels = { defaultMessage: "Automatically follow topics where I'm mentioned", }), automatically_unmute_topics_in_muted_streams_policy: $t({ - defaultMessage: "Automatically unmute topics in muted streams", + defaultMessage: "Automatically unmute topics in muted channels", }), desktop_icon_count_display: $t({ defaultMessage: "Unread count badge (appears in desktop sidebar and browser tab)", @@ -631,7 +631,7 @@ export const realm_user_settings_defaults_labels = { defaultMessage: "Let recipients see when a user is typing direct messages", }), realm_send_stream_typing_notifications: $t({ - defaultMessage: "Let recipients see when a user is typing stream messages", + defaultMessage: "Let recipients see when a user is typing channel messages", }), }; @@ -650,12 +650,12 @@ export const general_notifications_table_labels = { "all_mentions", ], stream: { - is_muted: $t({defaultMessage: "Mute stream"}), + is_muted: $t({defaultMessage: "Mute channel"}), desktop_notifications: $t({defaultMessage: "Visual desktop notifications"}), audible_notifications: $t({defaultMessage: "Audible desktop notifications"}), push_notifications: $t({defaultMessage: "Mobile notifications"}), email_notifications: $t({defaultMessage: "Email notifications"}), - pin_to_top: $t({defaultMessage: "Pin stream to top of left sidebar"}), + pin_to_top: $t({defaultMessage: "Pin channel to top of left sidebar"}), wildcard_mentions_notify: $t({defaultMessage: "Notifications for @all/@everyone mentions"}), }, }; @@ -849,7 +849,7 @@ export type AllNotifications = { export const all_notifications = (settings_object: Settings): AllNotifications => ({ general_settings: [ { - label: $t({defaultMessage: "Streams"}), + label: $t({defaultMessage: "Channels"}), notification_settings: get_notifications_table_row_data( stream_notification_settings, settings_object, @@ -966,7 +966,7 @@ export const user_topic_visibility_policy_values = { }, inherit: { code: 0, - description: $t({defaultMessage: "Default for stream"}), + description: $t({defaultMessage: "Default for channel"}), }, }; diff --git a/web/src/stream_popover.js b/web/src/stream_popover.js index 5c7d4d3f81..c63f413d1f 100644 --- a/web/src/stream_popover.js +++ b/web/src/stream_popover.js @@ -497,7 +497,7 @@ export async function build_move_topic_to_stream_popover( const stream = stream_data.get_sub_by_id(stream_id); if (stream === undefined) { $("#move_topic_to_stream_widget .dropdown_widget_value").text( - $t({defaultMessage: "Select a stream"}), + $t({defaultMessage: "Select a channel"}), ); } else { $("#move_topic_to_stream_widget .dropdown_widget_value").html( diff --git a/web/src/stream_settings_components.js b/web/src/stream_settings_components.js index 03a5f9c0fc..f32de3986d 100644 --- a/web/src/stream_settings_components.js +++ b/web/src/stream_settings_components.js @@ -36,7 +36,9 @@ export const show_subs_pane = { nothing_selected() { $(".settings, #stream-creation").hide(); $(".nothing-selected").show(); - $("#subscription_overlay .stream-info-title").text($t({defaultMessage: "Stream settings"})); + $("#subscription_overlay .stream-info-title").text( + $t({defaultMessage: "Channel settings"}), + ); }, settings(sub) { $(".settings, #stream-creation").hide(); @@ -46,7 +48,7 @@ export const show_subs_pane = { create_stream() { $(".nothing-selected, .settings, #stream-creation").hide(); $("#stream-creation").show(); - $("#subscription_overlay .stream-info-title").text($t({defaultMessage: "Create stream"})); + $("#subscription_overlay .stream-info-title").text($t({defaultMessage: "Create channel"})); }, }; @@ -140,8 +142,8 @@ export function ajaxSubscribe(stream, color, $stream_row) { true_stream_name = res.already_subscribed[people.my_current_email()][0]; ui_report.success( $t_html( - {defaultMessage: "Already subscribed to {stream}"}, - {stream: true_stream_name}, + {defaultMessage: "Already subscribed to {channel}"}, + {channel: true_stream_name}, ), $(".stream_change_property_info"), ); diff --git a/web/src/stream_settings_ui.js b/web/src/stream_settings_ui.js index 0d1e12d7e2..6d30eda5b6 100644 --- a/web/src/stream_settings_ui.js +++ b/web/src/stream_settings_ui.js @@ -261,7 +261,7 @@ export function add_sub_to_table(sub) { function show_first_stream_created_modal(stream) { dialog_widget.launch({ html_heading: $t_html( - {defaultMessage: "Stream created!"}, + {defaultMessage: "Channel created!"}, { "z-stream": () => render_inline_decorated_stream_name({stream}), }, @@ -604,7 +604,7 @@ export function setup_page(callback) { child_wants_focus: true, values: [ {label: $t({defaultMessage: "Subscribed"}), key: "subscribed"}, - {label: $t({defaultMessage: "All streams"}), key: "all-streams"}, + {label: $t({defaultMessage: "All channels"}), key: "all-streams"}, ], callback(_value, key) { switch_stream_tab(key); @@ -842,7 +842,7 @@ export function toggle_view(event) { if (event === "right_arrow" && stream_filter_tab === "Subscribed") { toggler.goto("all-streams"); - } else if (event === "left_arrow" && stream_filter_tab === "All streams") { + } else if (event === "left_arrow" && stream_filter_tab === "All channels") { toggler.goto("subscribed"); } } diff --git a/web/src/user_profile.js b/web/src/user_profile.js index e64f2458fb..bb3bfa9218 100644 --- a/web/src/user_profile.js +++ b/web/src/user_profile.js @@ -144,10 +144,10 @@ function reset_subscribe_widget() { $("#user-profile-modal .add-subscription-button").prop("disabled", true); settings_components.initialize_disable_btn_hint_popover( $("#user-profile-modal .add-subscription-button-wrapper"), - $t({defaultMessage: "Select a stream to subscribe"}), + $t({defaultMessage: "Select a channel to subscribe"}), ); $("#user_profile_subscribe_widget .dropdown_widget_value").text( - $t({defaultMessage: "Select a stream"}), + $t({defaultMessage: "Select a channel"}), ); // There are two cases when the subscribe widget is reset: when the user_profile // is setup (the object is null), or after subscribing of a user in the dropdown. @@ -435,7 +435,7 @@ export function show_user_profile(user, default_tab_key = "profile-tab") { child_wants_focus: true, values: [ {label: $t({defaultMessage: "Profile"}), key: "profile-tab"}, - {label: $t({defaultMessage: "Streams"}), key: "user-profile-streams-tab"}, + {label: $t({defaultMessage: "Channels"}), key: "user-profile-streams-tab"}, {label: $t({defaultMessage: "User groups"}), key: "user-profile-groups-tab"}, ], callback(_name, key) { @@ -909,13 +909,13 @@ export function initialize() { let error_message; if (people.is_my_user_id(target_user_id)) { error_message = $t( - {defaultMessage: "Error in unsubscribing from #{stream_name}"}, - {stream_name: sub.name}, + {defaultMessage: "Error in unsubscribing from #{channel_name}"}, + {channel_name: sub.name}, ); } else { error_message = $t( - {defaultMessage: "Error removing user from #{stream_name}"}, - {stream_name: sub.name}, + {defaultMessage: "Error removing user from #{channel_name}"}, + {channel_name: sub.name}, ); } diff --git a/web/src/user_topics_ui.js b/web/src/user_topics_ui.js index 5993574c2f..e5fce65365 100644 --- a/web/src/user_topics_ui.js +++ b/web/src/user_topics_ui.js @@ -34,7 +34,7 @@ export function handle_topic_updates(user_topic_event) { if ($row.length) { // If the row exists, update the status only. // We don't call 'populate_list' in this case as it re-creates the panel (re-sorts by date updated + - // removes topics with status set to 'Default for stream'), making it hard to review the changes + // removes topics with status set to 'Default for channel'), making it hard to review the changes // and undo if needed. const $status = $row.find("select.settings_user_topic_visibility_policy"); $status.val(visibility_policy); diff --git a/web/styles/compose.css b/web/styles/compose.css index fe795a3030..90a957b8e6 100644 --- a/web/styles/compose.css +++ b/web/styles/compose.css @@ -1177,7 +1177,7 @@ textarea.new_message_textarea, font-weight: lighter; } - /* This is the "Select a stream" default message */ + /* This is the "Select a channel" default message */ .text-warning { color: inherit; } diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css index 8212dea013..5413239718 100644 --- a/web/styles/left_sidebar.css +++ b/web/styles/left_sidebar.css @@ -1425,7 +1425,7 @@ li.topic-list-item { /* TODO: Rewrite the show-more and show-less buttons as grids alongside the left sidebar header rewrites. The 12px left padding here - aligns the "back to streams" text with the + aligns the "back to channels" text with the DIRECT MESSAGES heading above, which itself is offset -3 px to the left, but reserves 15px for the arrow marker. 15px - 3px = 12px. */ diff --git a/web/templates/compose_banner/stream_wildcard_warning.hbs b/web/templates/compose_banner/stream_wildcard_warning.hbs index 75125a55c0..1724ad4b99 100644 --- a/web/templates/compose_banner/stream_wildcard_warning.hbs +++ b/web/templates/compose_banner/stream_wildcard_warning.hbs @@ -1,7 +1,7 @@ {{#> compose_banner }} {{/compose_banner}} diff --git a/web/templates/gear_menu_popover.hbs b/web/templates/gear_menu_popover.hbs index d68e25fcbb..2cda23b9f1 100644 --- a/web/templates/gear_menu_popover.hbs +++ b/web/templates/gear_menu_popover.hbs @@ -57,7 +57,7 @@
  • -
    {{t "Default streams" }}
    +
    {{t "Default channels" }}
    {{#unless is_admin}} {{/unless}} diff --git a/web/templates/stream_settings/stream_settings_overlay.hbs b/web/templates/stream_settings/stream_settings_overlay.hbs index b82b34c902..b612532f95 100644 --- a/web/templates/stream_settings/stream_settings_overlay.hbs +++ b/web/templates/stream_settings/stream_settings_overlay.hbs @@ -3,7 +3,7 @@
    - {{t 'Streams' }} + {{t 'Channels' }}
    ×
    @@ -21,7 +21,7 @@
    + placeholder="{{t 'Filter channels' }}" value=""/> @@ -29,17 +29,17 @@
    - {{t 'There are no streams you can view in this organization.'}} + {{t 'There are no channels you can view in this organization.'}} {{#if can_create_streams}} - {{t 'Create a stream'}} + {{t 'Create a channel'}} {{/if}}
    @@ -49,14 +49,14 @@
    -
    {{t 'Stream settings' }}
    +
    {{t 'Channel settings' }}
    {{#if can_create_streams}} - + {{#tr}} - First time? Read our guidelines for creating and naming streams. + First time? Read our guidelines for creating and naming channels. {{#*inline "z-link"}}{{> @partial-block}}{{/inline}} {{/tr}} diff --git a/web/templates/stream_sidebar_actions.hbs b/web/templates/stream_sidebar_actions.hbs index 54e5ce0081..b66e1ba285 100644 --- a/web/templates/stream_sidebar_actions.hbs +++ b/web/templates/stream_sidebar_actions.hbs @@ -17,16 +17,16 @@
  • - {{t "Stream settings" }} + {{t "Channel settings" }}
  • {{#if stream.pin_to_top}} - {{t "Unpin stream from top"}} + {{t "Unpin channel from top"}} {{else}} - {{t "Pin stream to top"}} + {{t "Pin channel to top"}} {{/if}}
  • @@ -40,10 +40,10 @@ {{#if stream.is_muted}} - {{t "Unmute stream"}} + {{t "Unmute channel"}} {{else}} - {{t "Mute stream"}} + {{t "Mute channel"}} {{/if}} diff --git a/web/templates/subscribe_to_more_streams.hbs b/web/templates/subscribe_to_more_streams.hbs index 4d5026bf77..69735caa81 100644 --- a/web/templates/subscribe_to_more_streams.hbs +++ b/web/templates/subscribe_to_more_streams.hbs @@ -1,16 +1,16 @@ {{#if exactly_one_unsubscribed_stream}} - {{~t "Browse 1 more stream" ~}} + {{~t "Browse 1 more channel" ~}} {{else if can_subscribe_stream_count}} - {{~t "Browse {can_subscribe_stream_count} more streams" ~}} + {{~t "Browse {can_subscribe_stream_count} more channels" ~}} {{else if can_create_streams}} - {{~t "Create a stream" ~}} + {{~t "Create a channel" ~}} {{/if}} diff --git a/web/templates/tooltip_templates.hbs b/web/templates/tooltip_templates.hbs index 7869c81c93..12d2aef5e5 100644 --- a/web/templates/tooltip_templates.hbs +++ b/web/templates/tooltip_templates.hbs @@ -30,7 +30,7 @@ {{tooltip_hotkey_hints "C"}}