From c17e57421140ca2672dfe8ebe0ec587cf984fb2c Mon Sep 17 00:00:00 2001 From: Raghav Jajodia Date: Wed, 22 Feb 2017 01:14:43 +0530 Subject: [PATCH] Remove product_name setting and return to harcoding 'Zulip'. This removes some confusion in grep for frontend strings with Zulip in them and also cleans up the code in some places. Fixes #1602. --- frontend_tests/node_tests/i18n.js | 3 +-- static/js/notifications.js | 2 +- static/js/tutorial.js | 6 +++--- static/templates/email_address_hint.handlebars | 6 +++--- .../templates/settings/notification-settings.handlebars | 2 +- static/templates/tutorial_message.handlebars | 2 +- templates/zerver/base.html | 2 +- templates/zerver/home.html | 2 +- templates/zerver/invite_user.html | 2 +- templates/zerver/markdown_help.html | 8 ++++---- templates/zerver/navbar.html | 4 ++-- templates/zerver/right_sidebar.html | 4 ++-- templates/zerver/tutorial_finale.html | 4 ++-- zerver/lib/actions.py | 5 ++--- zerver/tests/test_home.py | 1 - zerver/tests/test_templates.py | 1 - zerver/views/home.py | 3 --- 17 files changed, 25 insertions(+), 32 deletions(-) diff --git a/frontend_tests/node_tests/i18n.js b/frontend_tests/node_tests/i18n.js index b3d13b3ab1..e33b9cf664 100644 --- a/frontend_tests/node_tests/i18n.js +++ b/frontend_tests/node_tests/i18n.js @@ -17,7 +17,7 @@ i18n.init({ fr: { translation: { "Quote and reply": "French", - "You'll receive notifications when a message arrives and __page_params.product_name__ isn't in focus or the message is offscreen.": "Some French text with __page_params.product_name__", + "You'll receive notifications when a message arrives and Zulip isn't in focus or the message is offscreen.": "Some French text with Zulip", }, }, }, @@ -53,7 +53,6 @@ global.$ = require('jquery')(window); var args = { page_params: { fullname: "John Doe", - product_name: "Zulip", password_auth_enabled: false, avatar_url: "http://example.com", left_side_userlist: false, diff --git a/static/js/notifications.js b/static/js/notifications.js index 2a65541b13..abd0c0fece 100644 --- a/static/js/notifications.js +++ b/static/js/notifications.js @@ -148,7 +148,7 @@ exports.redraw_title = function () { var new_title = (new_message_count ? ("(" + new_message_count + ") ") : "") + narrow.narrow_title + " - " + page_params.realm_name + " - " - + page_params.product_name; + + "Zulip"; if (document.title === new_title) { return; diff --git a/static/js/tutorial.js b/static/js/tutorial.js index 05f36f3d74..ff9f29e315 100644 --- a/static/js/tutorial.js +++ b/static/js/tutorial.js @@ -366,8 +366,8 @@ function finale(skip) { if (stream_data.in_home_view(page_params.notifications_stream)) { send_delayed_stream_message(page_params.notifications_stream, "welcome", "Practice sending sending some messages here, or starting a new topic.", 15); - send_delayed_stream_message(page_params.notifications_stream, page_params.product_name + " tips", "Here's a message on a new topic: `" + page_params.product_name + " tips`.\n\nAs you settle into " + page_params.product_name + ", customize your account and notifications on your [Settings page](#settings).", 30); - send_delayed_stream_message(page_params.notifications_stream, page_params.product_name + " tips", "You might also enjoy:\n\n* Our lightweight !modal_link(#markdown-help, message formatting) (including emoji! :thumbsup:)\n* !modal_link(#keyboard-shortcuts, Keyboard shortcuts)\n* [Desktop and mobile apps](/apps)", 40); + send_delayed_stream_message(page_params.notifications_stream, "Zulip tips", "Here's a message on a new topic: `Zulip tips`.\n\nAs you settle into Zulip, customize your account and notifications on your [Settings page](#settings).", 30); + send_delayed_stream_message(page_params.notifications_stream, "Zulip tips", "You might also enjoy:\n\n* Our lightweight !modal_link(#markdown-help, message formatting) (including emoji! :thumbsup:)\n* !modal_link(#keyboard-shortcuts, Keyboard shortcuts)\n* [Desktop and mobile apps](/apps)", 40); } if (work_stream !== undefined) { @@ -486,7 +486,7 @@ function welcome() { var spotlight_message = rows.first_visible(); var bar = rows.get_message_recipient_header(spotlight_message); box_first_message(); - create_and_show_popover(bar, maybe_tweak_placement("left"), "Welcome to " + page_params.product_name, + create_and_show_popover(bar, maybe_tweak_placement("left"), "Welcome to Zulip", "tutorial_message"); var my_popover = $("#tutorial-message").closest(".popover"); diff --git a/static/templates/email_address_hint.handlebars b/static/templates/email_address_hint.handlebars index cc59bddd7c..2b65a92a72 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 }}
-

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

+

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

diff --git a/static/templates/settings/notification-settings.handlebars b/static/templates/settings/notification-settings.handlebars index d6a18f8b7c..d1524ebdc0 100644 --- a/static/templates/settings/notification-settings.handlebars +++ b/static/templates/settings/notification-settings.handlebars @@ -5,7 +5,7 @@
-
{{#tr this }}You'll receive notifications when a message arrives and __page_params.product_name__ isn't in focus or the message is offscreen.{{/tr}}
+
{{#tr this }}You'll receive notifications when a message arrives and Zulip isn't in focus or the message is offscreen.{{/tr}}

{{t "Stream messages" }}

diff --git a/static/templates/tutorial_message.handlebars b/static/templates/tutorial_message.handlebars index 339fe85d75..050ee38858 100644 --- a/static/templates/tutorial_message.handlebars +++ b/static/templates/tutorial_message.handlebars @@ -1,7 +1,7 @@ {{! Contents of the "tutorial message" onboarding popup }}
- {{#tr this}}

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

{{/tr}} + {{#tr this}}

Messages in Zulip go to a stream and have a topic.

{{/tr}}
diff --git a/templates/zerver/base.html b/templates/zerver/base.html index 269683b852..c96c037ba7 100644 --- a/templates/zerver/base.html +++ b/templates/zerver/base.html @@ -7,7 +7,7 @@ {% block title %} {% if user_profile and user_profile.realm.name %} - {{user_profile.realm.name}} - {{product_name}} + {{user_profile.realm.name}} - Zulip {% else %} Zulip {% endif %} diff --git a/templates/zerver/home.html b/templates/zerver/home.html index 27efa5df01..eeddb2b59e 100644 --- a/templates/zerver/home.html +++ b/templates/zerver/home.html @@ -11,7 +11,7 @@
-

{% trans %}Welcome to {{product_name}}.{% endtrans %}

+

{% trans %}Welcome to Zulip.{% endtrans %}

{% trans %}

See, the thing about it is... there aren't any messages here for you right now. I'm sure someone will eventually send diff --git a/templates/zerver/invite_user.html b/templates/zerver/invite_user.html index 2eca0d9b13..b0d7f82728 100644 --- a/templates/zerver/invite_user.html +++ b/templates/zerver/invite_user.html @@ -2,7 +2,7 @@ aria-labelledby="invite-user-label" aria-hidden="true">

{{ csrf_input }} diff --git a/templates/zerver/markdown_help.html b/templates/zerver/markdown_help.html index 004771ab22..25becce2a3 100644 --- a/templates/zerver/markdown_help.html +++ b/templates/zerver/markdown_help.html @@ -62,19 +62,19 @@ ``` def zulip(): - print "{{product_name}}" + print "Zulip" ```
def zulip():
-    print "{{product_name}}"
+ print "Zulip" ``` .py def zulip(): - print "{{product_name}}" + print "Zulip" ```
def zulip():
-    print "{{product_name}}"
+ print "Zulip"
diff --git a/templates/zerver/navbar.html b/templates/zerver/navbar.html index 550b490c30..7768ed257a 100644 --- a/templates/zerver/navbar.html +++ b/templates/zerver/navbar.html @@ -110,7 +110,7 @@ {% endif %} {% if show_invites %} -
  • +
  • {{ _('Invite users') }} @@ -118,7 +118,7 @@
  • {% endif %} {% if show_webathena %} -
  • +
  • diff --git a/templates/zerver/right_sidebar.html b/templates/zerver/right_sidebar.html index f8bfac0031..a10ae6a555 100644 --- a/templates/zerver/right_sidebar.html +++ b/templates/zerver/right_sidebar.html @@ -1,11 +1,11 @@