From ac13187d763db2cc082a0b540272f9a3548b38ef Mon Sep 17 00:00:00 2001 From: Umair Khan Date: Thu, 12 May 2016 16:53:41 +0500 Subject: [PATCH] Add translation tags to the templates. Fixes #726 --- .../actions_popover_content.handlebars | 12 +- static/templates/admin_emoji_list.handlebars | 2 +- .../templates/admin_streams_list.handlebars | 2 +- static/templates/admin_tab.handlebars | 86 ++++++------- static/templates/admin_user_list.handlebars | 8 +- .../alert_word_settings_item.handlebars | 2 +- .../templates/announce_stream_docs.handlebars | 2 + static/templates/bankruptcy_modal.handlebars | 4 +- static/templates/bot_avatar_row.handlebars | 24 ++-- .../change_stream_privacy.handlebars | 4 +- .../templates/compose-invite-users.handlebars | 6 +- .../templates/email_address_hint.handlebars | 8 +- .../templates/invite_subscription.handlebars | 4 +- static/templates/message_edit_form.handlebars | 12 +- .../message_info_popover_content.handlebars | 10 +- .../message_info_popover_title.handlebars | 4 +- static/templates/new_stream_users.handlebars | 4 +- .../propagate_notification_change.handlebars | 6 +- static/templates/recipient_row.handlebars | 10 +- static/templates/settings_tab.handlebars | 115 +++++++++--------- .../sidebar_private_message_list.handlebars | 2 +- .../templates/sidebar_subject_list.handlebars | 2 +- static/templates/single_message.handlebars | 10 +- .../stream_member_list_entry.handlebars | 2 +- .../stream_sidebar_actions.handlebars | 14 +-- static/templates/subscription.handlebars | 24 ++-- .../subscription_table_body.handlebars | 4 +- static/templates/subscription_type.handlebars | 5 +- .../topic_sidebar_actions.handlebars | 8 +- static/templates/tutorial_home.handlebars | 4 +- static/templates/tutorial_message.handlebars | 6 +- static/templates/tutorial_reply.handlebars | 4 +- static/templates/tutorial_stream.handlebars | 4 +- static/templates/tutorial_subject.handlebars | 4 +- .../templates/user_sidebar_actions.handlebars | 6 +- 35 files changed, 219 insertions(+), 205 deletions(-) diff --git a/static/templates/actions_popover_content.handlebars b/static/templates/actions_popover_content.handlebars index 5c7089713e..7984fc0b6c 100644 --- a/static/templates/actions_popover_content.handlebars +++ b/static/templates/actions_popover_content.handlebars @@ -3,21 +3,21 @@ {{#if can_edit_message}}
  • - Edit + {{t "Edit" }}
  • {{/if}}
  • - Reply + {{t "Reply" }}
  • - {{#if message.collapsed}}Un-collapse{{else}}Collapse{{/if}} + {{#if message.collapsed}}{{t "Un-collapse" }}{{else}}{{t "Collapse" }}{{/if}}
  • @@ -25,7 +25,7 @@
  • - Mute the topic {{message.subject}} + {{#tr message}}Mute the topic __subject__{{/tr}}
  • {{/if}} @@ -34,14 +34,14 @@
  • - Unmute the topic {{message.subject}} + {{#tr message}}Unmute the topic __subject__{{/tr}}
  • {{/if}}
  • - Link to this conversation + {{t "Link to this conversation" }}
  • diff --git a/static/templates/admin_emoji_list.handlebars b/static/templates/admin_emoji_list.handlebars index a17ea5d56f..cbf2c66b4c 100644 --- a/static/templates/admin_emoji_list.handlebars +++ b/static/templates/admin_emoji_list.handlebars @@ -8,7 +8,7 @@ diff --git a/static/templates/admin_streams_list.handlebars b/static/templates/admin_streams_list.handlebars index c27a71aa3f..57d00e65da 100644 --- a/static/templates/admin_streams_list.handlebars +++ b/static/templates/admin_streams_list.handlebars @@ -6,7 +6,7 @@ diff --git a/static/templates/admin_tab.handlebars b/static/templates/admin_tab.handlebars index f3f6553a88..e0d28adf42 100644 --- a/static/templates/admin_tab.handlebars +++ b/static/templates/admin_tab.handlebars @@ -2,29 +2,29 @@
    -

    Administration

    +

    {{t "Administration" }}

    - Organization settings
    + {{t "Organization settings" }}
    @@ -39,19 +39,19 @@
    - +
    - +
    - +
    @@ -63,40 +63,40 @@
    - +
    - Custom realm emoji
    + {{t "Custom realm emoji" }}
    - - - + + +
    NameImageActions{{t "Name" }}{{t "Image" }}{{t "Actions" }}
    -
    Add a New Emoji
    +
    {{t "Add a New Emoji" }}
    - +
    - +
    - +
    @@ -107,12 +107,12 @@
    - Users
    + {{t "Users" }}
    - - - + + +
    NameEmailActions{{t "Name" }}{{t "Email" }}{{t "Actions" }}
    @@ -121,12 +121,12 @@
    - Deactivated Users
    + {{t "Deactivated Users" }}
    - - - + + +
    NameEmailActions{{t "Name" }}{{t "Email" }}{{t "Actions" }}
    @@ -135,13 +135,13 @@
    - Bots
    + {{t "Bots" }}
    - - - - + + + +
    NameEmailOwnerActions{{t "Name" }}{{t "Email" }}{{t "Owner" }}{{t "Actions" }}
    @@ -155,8 +155,8 @@ - - + +
    NameActions{{t "Name" }}{{t "Actions" }}
    @@ -167,28 +167,28 @@
    diff --git a/static/templates/admin_user_list.handlebars b/static/templates/admin_user_list.handlebars index 9ef9480628..2e0999636f 100644 --- a/static/templates/admin_user_list.handlebars +++ b/static/templates/admin_user_list.handlebars @@ -14,22 +14,22 @@ {{#if is_active}} {{else}} {{/if}} {{#if is_active_human}} {{#if is_admin}} {{else}} {{/if}} {{/if}} diff --git a/static/templates/alert_word_settings_item.handlebars b/static/templates/alert_word_settings_item.handlebars index 8e9107160e..636c5c1d0c 100644 --- a/static/templates/alert_word_settings_item.handlebars +++ b/static/templates/alert_word_settings_item.handlebars @@ -1,7 +1,7 @@ {{! Alert word in the settings page that can be removed }}
  • {{#if editing}} - + {{else}} {{word}} {{/if}} diff --git a/static/templates/announce_stream_docs.handlebars b/static/templates/announce_stream_docs.handlebars index 849621b704..a529a4545d 100644 --- a/static/templates/announce_stream_docs.handlebars +++ b/static/templates/announce_stream_docs.handlebars @@ -1,7 +1,9 @@ {{! Explanation of what "announce stream" does when creating a stream }}
    + {{#tr this}}

    Lets everyone know about the new stream,
    even if you don't add them.

    + {{/tr}}
    diff --git a/static/templates/bankruptcy_modal.handlebars b/static/templates/bankruptcy_modal.handlebars index f19da2fbaa..3f0c266142 100644 --- a/static/templates/bankruptcy_modal.handlebars +++ b/static/templates/bankruptcy_modal.handlebars @@ -1,6 +1,6 @@ {{! The unread count in the bankruptcy modal }} diff --git a/static/templates/bot_avatar_row.handlebars b/static/templates/bot_avatar_row.handlebars index 1e295ab0b1..4664c5dca2 100644 --- a/static/templates/bot_avatar_row.handlebars +++ b/static/templates/bot_avatar_row.handlebars @@ -5,25 +5,25 @@
    {{name}}
    - API Key + {{t "API Key" }} {{api_key}} -
    - -
    @@ -35,33 +35,33 @@
    {{email}}
    - +
    - +
    - +
    - +
    - - + +
    - +
    diff --git a/static/templates/change_stream_privacy.handlebars b/static/templates/change_stream_privacy.handlebars index 134c4ce9dc..032de00407 100644 --- a/static/templates/change_stream_privacy.handlebars +++ b/static/templates/change_stream_privacy.handlebars @@ -1,11 +1,11 @@ {{#if can_make_public}} {{/if}} {{#if can_make_private}} {{/if}}
    diff --git a/static/templates/compose-invite-users.handlebars b/static/templates/compose-invite-users.handlebars index 247a57e7ca..86f1f8e922 100644 --- a/static/templates/compose-invite-users.handlebars +++ b/static/templates/compose-invite-users.handlebars @@ -1,7 +1,7 @@
    - {{name}} is not subscribed to this stream. + {{#tr this}}__name__ is not subscribed to this stream.{{/tr}}
    - - + +
    diff --git a/static/templates/email_address_hint.handlebars b/static/templates/email_address_hint.handlebars index d770d52074..37f3fef4cc 100644 --- a/static/templates/email_address_hint.handlebars +++ b/static/templates/email_address_hint.handlebars @@ -1,14 +1,14 @@ {{! Explanation of the stream email address }}
    -

    You can send emails to {{ page_params.product_name }}! Just copy and use this address as an email recipient, and:

    +

    {{#tr this}}You can send emails to __page_params.product_name__! Just copy and use this address as an email recipient, and:{{/tr}}

      -
    • The email will be forwarded to this stream
    • -
    • The email subject will become the {{ page_params.product_name }} topic
    • -
    • The email body will become the {{ page_params.product_name }} message
    • +
    • {{t "The email will be forwarded to this stream" }}
    • +
    • {{#tr this}}The email subject will become the __page_params.product_name__ topic{{/tr}}
    • +
    • {{#tr this}}The email body will become the __page_params.product_name__ message{{/tr}}
    diff --git a/static/templates/invite_subscription.handlebars b/static/templates/invite_subscription.handlebars index 7261e49f66..38354f913c 100644 --- a/static/templates/invite_subscription.handlebars +++ b/static/templates/invite_subscription.handlebars @@ -1,6 +1,6 @@ {{! Client-side Mustache template for rendering subscriptions in the "invite user" form.}} -Check all | -Uncheck all +{{t "Check all" }} | +{{t "Uncheck all" }}
    {{#each streams}}
    - - + +
    diff --git a/static/templates/message_info_popover_content.handlebars b/static/templates/message_info_popover_content.handlebars index 6e4cc1107d..539205f6ed 100644 --- a/static/templates/message_info_popover_content.handlebars +++ b/static/templates/message_info_popover_content.handlebars @@ -1,30 +1,30 @@ {{! Contents of the "message info" popup }} diff --git a/static/templates/message_info_popover_title.handlebars b/static/templates/message_info_popover_title.handlebars index 5bdc423c14..227cafd6ef 100644 --- a/static/templates/message_info_popover_title.handlebars +++ b/static/templates/message_info_popover_title.handlebars @@ -1,6 +1,6 @@ {{! Title of the "message actions" popup }} {{#if message.is_stream}} -Message to stream {{message.stream}} +{{#tr this}}Message to stream __message.stream__{{/tr}} {{else}} -Private message +{{t "Private message" }} {{/if}} diff --git a/static/templates/new_stream_users.handlebars b/static/templates/new_stream_users.handlebars index ab39f117b6..4d315c5651 100644 --- a/static/templates/new_stream_users.handlebars +++ b/static/templates/new_stream_users.handlebars @@ -1,6 +1,6 @@ {{! Client-side Mustache template for rendering users in the stream creation modal.}} -Check all | -Uncheck all +{{t "Check all" }} | +{{t "Uncheck all" }}
    {{#each users}}
    diff --git a/static/templates/settings_tab.handlebars b/static/templates/settings_tab.handlebars index a7076ce474..df97fb2755 100644 --- a/static/templates/settings_tab.handlebars +++ b/static/templates/settings_tab.handlebars @@ -1,16 +1,16 @@ -

    Settings

    +

    {{t "Settings" }}

    -
    Your Account
    +
    {{t "Your Account" }}
  • - (more conversations) + ({{t "more conversations" }})
  • {{/if}} diff --git a/static/templates/sidebar_subject_list.handlebars b/static/templates/sidebar_subject_list.handlebars index 5fc011d32f..2d4dc76903 100644 --- a/static/templates/sidebar_subject_list.handlebars +++ b/static/templates/sidebar_subject_list.handlebars @@ -16,7 +16,7 @@ {{/each}} {{#if want_show_more_topics_links}}
  • - (more topics) + ({{t "more topics" }})
  • {{/if}} diff --git a/static/templates/single_message.handlebars b/static/templates/single_message.handlebars index 880bbf7d6e..81426f10be 100644 --- a/static/templates/single_message.handlebars +++ b/static/templates/single_message.handlebars @@ -15,12 +15,12 @@ {{/include_sender}} {{timestr}} {{#if_and last_edit_timestr include_sender}} -
    EDITED
    +
    {{t "EDITED" }}
    {{/if_and}}
    + title="{{#tr this}}{{#if msg/starred}}Unstar{{else}}Star{{/if}} this message{{/tr}}">
    @@ -33,14 +33,14 @@
    {{#unless status_message}}{{#if use_match_properties}}{{{msg/match_content}}}{{else}}{{{msg/content}}}{{/if}}{{/unless}}
    {{#if last_edit_timestr}} {{#unless include_sender}} -
    EDITED
    +
    {{t "EDITED" }}
    {{/unless}} {{/if}}
    -
    [More...]
    -
    [Condense this message]
    +
    {{t "[More...]" }}
    +
    {{t "[Condense this message]" }}
    diff --git a/static/templates/stream_member_list_entry.handlebars b/static/templates/stream_member_list_entry.handlebars index d62c3be79e..280f665f30 100644 --- a/static/templates/stream_member_list_entry.handlebars +++ b/static/templates/stream_member_list_entry.handlebars @@ -5,7 +5,7 @@
    -
    diff --git a/static/templates/stream_sidebar_actions.handlebars b/static/templates/stream_sidebar_actions.handlebars index 03d6c1b6e1..0072dfd41a 100644 --- a/static/templates/stream_sidebar_actions.handlebars +++ b/static/templates/stream_sidebar_actions.handlebars @@ -3,41 +3,41 @@
  • - Narrow to stream {{stream.name}} + {{#tr this}}Narrow to stream __stream.name__{{/tr}}
  • {{#if stream.in_home_view}} - Mute the stream {{stream.name}} + {{#tr this}}Mute the stream __stream.name__{{/tr}} {{else}} - Unmute the stream {{stream.name}} + {{#tr this}}Unmute the stream __stream.name__{{/tr}} {{/if}}
  • - Compose a message to stream {{stream.name}} + {{#tr this}}Compose a message to stream __stream.name__{{/tr}}
  • - Mark all messages in {{stream.name}} as read + {{#tr this}}Mark all messages in __stream.name__ as read{{/tr}}
  • - Stream settings + {{t "Stream settings" }}
  • - Choose custom color + {{t "Choose custom color" }}
  • diff --git a/static/templates/subscription.handlebars b/static/templates/subscription.handlebars index 908e6d22d5..ab6668baac 100644 --- a/static/templates/subscription.handlebars +++ b/static/templates/subscription.handlebars @@ -13,10 +13,10 @@
    @@ -32,7 +32,7 @@
    -

    Muted streams don't show up in your home view or generate notifications unless you are mentioned.

    +

    {{t "Muted streams don't show up in your home view or generate notifications unless you are mentioned." }}

  • @@ -40,13 +40,13 @@
    - +
    - +
  • @@ -54,7 +54,7 @@ - +
    @@ -70,18 +70,18 @@ {{#if is_admin}}
    - Administrator settings + {{t "Administrator settings" }}
    - +
    - +
    @@ -92,11 +92,11 @@ {{#render_subscribers}}
    - Stream membership + {{t "Stream membership" }}
    - - + +
    diff --git a/static/templates/subscription_table_body.handlebars b/static/templates/subscription_table_body.handlebars index f30cf7b062..72f261bfe0 100644 --- a/static/templates/subscription_table_body.handlebars +++ b/static/templates/subscription_table_body.handlebars @@ -3,9 +3,9 @@
    + placeholder="{{t 'Stream name' }}" value="" /> + id="create_stream_button" value="{{t 'Create new stream' }}" />
    diff --git a/static/templates/subscription_type.handlebars b/static/templates/subscription_type.handlebars index 7c0843f654..6819e85d86 100644 --- a/static/templates/subscription_type.handlebars +++ b/static/templates/subscription_type.handlebars @@ -1,3 +1,2 @@ -This is -{{#if invite_only}}an invite-only stream. Only people who have been invited can access its content, but any member of the stream can invite others. -{{else}}a public stream. Anybody in your organization can join.{{/if}} +{{#if invite_only}}{{t 'This is an invite-only stream. Only people who have been invited can access its content, but any member of the stream can invite others.' }} +{{else}}{{t 'This is a public stream. Anybody in your organization can join.' }}{{/if}} diff --git a/static/templates/topic_sidebar_actions.handlebars b/static/templates/topic_sidebar_actions.handlebars index 027d3f983c..ded3213008 100644 --- a/static/templates/topic_sidebar_actions.handlebars +++ b/static/templates/topic_sidebar_actions.handlebars @@ -2,7 +2,7 @@
  • - Narrow to topic {{ topic_name }} + {{#tr this}}Narrow to topic __topic_name__{{/tr}}
  • @@ -11,7 +11,7 @@
  • - Mute the topic {{ topic_name }} + {{#tr this}}Mute the topic __topic_name__{{/tr}}
  • {{/if}} @@ -20,14 +20,14 @@
  • - Unmute the topic {{ topic_name }} + {{#tr this}}Unmute the topic __topic_name__{{/tr}}
  • {{/if}}
  • - Mark all messages in {{topic_name}} as read + {{#tr this}}Mark all messages in __topic_name__ as read{{/tr}}
  • diff --git a/static/templates/tutorial_home.handlebars b/static/templates/tutorial_home.handlebars index 69b41689b2..943e36f6a0 100644 --- a/static/templates/tutorial_home.handlebars +++ b/static/templates/tutorial_home.handlebars @@ -2,10 +2,12 @@
    + {{#tr this}}

    You can narrow to a stream or topic by clicking on it, or see messages from all streams at once from your Home view.

    + {{/tr}}
    - +
    diff --git a/static/templates/tutorial_message.handlebars b/static/templates/tutorial_message.handlebars index 37ebedab53..5898d207c1 100644 --- a/static/templates/tutorial_message.handlebars +++ b/static/templates/tutorial_message.handlebars @@ -1,11 +1,11 @@ {{! Contents of the "tutorial message" onboarding popup }}
    -

    Welcome to {{ page_params.product_name }}!

    + {{#tr this}}

    Welcome to __page_params.product_name__!

    {{/tr}} -

    Messages in {{ page_params.product_name }} go to a stream and have a topic.

    + {{#tr this}}

    Messages in __page_params.product_name__ go to a stream and have a topic.

    {{/tr}}
    - +
    diff --git a/static/templates/tutorial_reply.handlebars b/static/templates/tutorial_reply.handlebars index 2c811353b7..3af8699419 100644 --- a/static/templates/tutorial_reply.handlebars +++ b/static/templates/tutorial_reply.handlebars @@ -2,10 +2,12 @@
    + {{#tr this}}

    Reply to a message by clicking on it. The stream and topic will automatically be filled in.

    + {{/tr}}
    - +
    diff --git a/static/templates/tutorial_stream.handlebars b/static/templates/tutorial_stream.handlebars index 5f5c0dfdb0..97315cb0e0 100644 --- a/static/templates/tutorial_stream.handlebars +++ b/static/templates/tutorial_stream.handlebars @@ -2,11 +2,13 @@

    + {{#tr this}} Streams are like chat rooms or mailing lists. You can easily join, leave, and make them. + {{/tr}}

    - +
    diff --git a/static/templates/tutorial_subject.handlebars b/static/templates/tutorial_subject.handlebars index 3743b28eb8..0c6fd6481f 100644 --- a/static/templates/tutorial_subject.handlebars +++ b/static/templates/tutorial_subject.handlebars @@ -3,12 +3,14 @@

    + {{#tr this}} The topic of a conversation is one or two words that describe what it is about, for example: Bug #345, lunch, or logo. Don't overthink it. + {{/tr}}

    - +
    diff --git a/static/templates/user_sidebar_actions.handlebars b/static/templates/user_sidebar_actions.handlebars index c9e4fdbef5..c227089304 100644 --- a/static/templates/user_sidebar_actions.handlebars +++ b/static/templates/user_sidebar_actions.handlebars @@ -3,19 +3,19 @@
  • - Narrow to private messages with {{name}} + {{#tr this}}Narrow to private messages with __name__{{/tr}}
  • - Narrow to messages sent by {{name}} + {{#tr this}}Narrow to messages sent by __name__{{/tr}}
  • - Compose a message to {{name}} + {{#tr this}}Compose a message to __name__{{/tr}}