From 83b68660188eacece2b9ffc775ae9c0140249a91 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 15 Mar 2023 15:51:27 -0700 Subject: [PATCH] templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `{{#tr}}` supports HTML and allows translators to accidentally introduce HTML, so it’s safer to use the `{{t}}` helper unless HTML is needed. Signed-off-by: Anders Kaseorg --- web/templates/about_zulip.hbs | 8 +--- web/templates/actions_popover_content.hbs | 4 +- .../all_messages_sidebar_actions.hbs | 2 +- web/templates/bookend.hbs | 6 +-- web/templates/compose.hbs | 4 +- .../confirm_deactivate_own_user.hbs | 2 +- .../confirm_deactivate_user.hbs | 8 +--- .../confirm_delete_all_drafts.hbs | 4 +- .../confirm_delete_profile_field_option.hbs | 4 +- .../confirm_dialog/confirm_delete_user.hbs | 4 +- .../confirm_delete_user_avatar.hbs | 4 +- .../confirm_mark_all_as_read.hbs | 4 +- .../confirm_subscription_invites_warning.hbs | 4 +- .../confirm_unstar_all_messages.hbs | 4 +- web/templates/default_language_modal.hbs | 6 +-- web/templates/draft.hbs | 2 +- web/templates/draft_table_body.hbs | 2 +- web/templates/drafts_sidebar_action.hbs | 2 +- web/templates/edited_notice.hbs | 6 +-- web/templates/empty_feed_notice.hbs | 2 +- web/templates/gear_menu.hbs | 2 +- web/templates/login_to_access.hbs | 10 ++--- web/templates/message_controls.hbs | 18 ++++----- web/templates/message_edit_form.hbs | 2 +- web/templates/message_hidden_dialog.hbs | 4 +- web/templates/navbar_alerts/bankruptcy.hbs | 4 +- .../playground_links_popover_content.hbs | 4 +- web/templates/recipient_row.hbs | 12 +++--- .../settings/default_streams_list_admin.hbs | 2 +- .../settings/emoji_settings_admin.hbs | 2 +- .../settings/linkifier_settings_admin.hbs | 20 ++++------ .../settings/playground_settings_admin.hbs | 6 +-- web/templates/settings/upload_space_stats.hbs | 2 +- .../starred_messages_sidebar_actions.hbs | 6 +-- .../stream_settings/stream_settings.hbs | 6 +-- .../stream_settings/stream_types.hbs | 2 +- web/templates/topic_sidebar_actions.hbs | 2 +- web/templates/typing_notification.hbs | 2 +- web/templates/user_info_popover_content.hbs | 40 +++++++++---------- .../user_info_popover_manage_menu.hbs | 8 ++-- web/templates/user_profile_modal.hbs | 18 ++++----- 41 files changed, 109 insertions(+), 145 deletions(-) diff --git a/web/templates/about_zulip.hbs b/web/templates/about_zulip.hbs index 7d99315212..aa70e18bb7 100644 --- a/web/templates/about_zulip.hbs +++ b/web/templates/about_zulip.hbs @@ -8,15 +8,11 @@

Zulip Server
- {{#tr}} - Version {zulip_version} - {{/tr}} + {{t "Version {zulip_version}" }} {{#if is_fork}}
- {{#tr}} - Forked from upstream at {zulip_merge_base} - {{/tr}} + {{t "Forked from upstream at {zulip_merge_base}" }} {{/if}}

diff --git a/web/templates/actions_popover_content.hbs b/web/templates/actions_popover_content.hbs index c637a7d9e4..257a1e9b09 100644 --- a/web/templates/actions_popover_content.hbs +++ b/web/templates/actions_popover_content.hbs @@ -45,7 +45,7 @@
  • - {{#tr}}Add emoji reaction{{/tr}} + {{t "Add emoji reaction" }}

  • @@ -121,7 +121,7 @@ {{#if should_display_read_receipts_option}}
  • - {{t "View read receipts" }} + {{t "View read receipts" }}
  • {{/if}} diff --git a/web/templates/all_messages_sidebar_actions.hbs b/web/templates/all_messages_sidebar_actions.hbs index 75a254bb56..0a34f5eb29 100644 --- a/web/templates/all_messages_sidebar_actions.hbs +++ b/web/templates/all_messages_sidebar_actions.hbs @@ -4,7 +4,7 @@ {{! tabindex="0" Makes anchor tag focusable. Needed for keyboard support. }} - {{#tr}}Mark all messages as read{{/tr}} + {{t "Mark all messages as read" }} diff --git a/web/templates/bookend.hbs b/web/templates/bookend.hbs index b156609c45..e9660785e0 100644 --- a/web/templates/bookend.hbs +++ b/web/templates/bookend.hbs @@ -9,11 +9,11 @@ {{#if deactivated}} {{t "This stream has been deactivated" }} {{else if subscribed }} - {{#tr}}You subscribed to stream {stream_name}{{/tr}} + {{t "You subscribed to stream {stream_name}" }} {{else if just_unsubscribed }} - {{#tr}}You unsubscribed from stream {stream_name}{{/tr}} + {{t "You unsubscribed from stream {stream_name}" }} {{else}} - {{#tr}}You are not subscribed to stream {stream_name}{{/tr}} + {{t "You are not subscribed to stream {stream_name}" }} {{/if}} {{/if}} diff --git a/web/templates/compose.hbs b/web/templates/compose.hbs index a8d9cefcef..dacdedabd7 100644 --- a/web/templates/compose.hbs +++ b/web/templates/compose.hbs @@ -145,7 +145,7 @@ diff --git a/web/templates/confirm_dialog/confirm_deactivate_own_user.hbs b/web/templates/confirm_dialog/confirm_deactivate_own_user.hbs index 9a545a31e5..c11a52bacd 100644 --- a/web/templates/confirm_dialog/confirm_deactivate_own_user.hbs +++ b/web/templates/confirm_dialog/confirm_deactivate_own_user.hbs @@ -1,3 +1,3 @@ -

    {{#tr}}By deactivating your account, you will be logged out immediately.{{/tr}}

    +

    {{t "By deactivating your account, you will be logged out immediately." }}

    {{t "Note that any bots that you maintain will be disabled." }}

    {{t "Are you sure you want to deactivate your account?"}}

    diff --git a/web/templates/confirm_dialog/confirm_deactivate_user.hbs b/web/templates/confirm_dialog/confirm_deactivate_user.hbs index bac75f92db..1be9751fb3 100644 --- a/web/templates/confirm_dialog/confirm_deactivate_user.hbs +++ b/web/templates/confirm_dialog/confirm_deactivate_user.hbs @@ -22,17 +22,13 @@