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.
This commit is contained in:
Raghav Jajodia
2017-02-22 01:14:43 +05:30
committed by Tim Abbott
parent 60296c022c
commit c17e574211
17 changed files with 25 additions and 32 deletions

View File

@@ -17,7 +17,7 @@ i18n.init({
fr: { fr: {
translation: { translation: {
"Quote and reply": "French", "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 = { var args = {
page_params: { page_params: {
fullname: "John Doe", fullname: "John Doe",
product_name: "Zulip",
password_auth_enabled: false, password_auth_enabled: false,
avatar_url: "http://example.com", avatar_url: "http://example.com",
left_side_userlist: false, left_side_userlist: false,

View File

@@ -148,7 +148,7 @@ exports.redraw_title = function () {
var new_title = (new_message_count ? ("(" + new_message_count + ") ") : "") var new_title = (new_message_count ? ("(" + new_message_count + ") ") : "")
+ narrow.narrow_title + " - " + narrow.narrow_title + " - "
+ page_params.realm_name + " - " + page_params.realm_name + " - "
+ page_params.product_name; + "Zulip";
if (document.title === new_title) { if (document.title === new_title) {
return; return;

View File

@@ -366,8 +366,8 @@ function finale(skip) {
if (stream_data.in_home_view(page_params.notifications_stream)) { 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, "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, "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, 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", "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) { if (work_stream !== undefined) {
@@ -486,7 +486,7 @@ function welcome() {
var spotlight_message = rows.first_visible(); var spotlight_message = rows.first_visible();
var bar = rows.get_message_recipient_header(spotlight_message); var bar = rows.get_message_recipient_header(spotlight_message);
box_first_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"); "tutorial_message");
var my_popover = $("#tutorial-message").closest(".popover"); var my_popover = $("#tutorial-message").closest(".popover");

View File

@@ -1,14 +1,14 @@
{{! Explanation of the stream email address }} {{! Explanation of the stream email address }}
<div> <div>
<p>{{#tr this}}You can send emails to __page_params.product_name__! Just copy and use this address as an email recipient, and:{{/tr}}</p> <p>{{#tr this}}You can send emails to Zulip! Just copy and use this address as an email recipient, and:{{/tr}}</p>
<img class="subscription-email-hint-image" src="/static/images/integrations/zulip_mail.png" /> <img class="subscription-email-hint-image" src="/static/images/integrations/zulip_mail.png" />
<ul> <ul>
<li>{{t "The email will be forwarded to this stream" }}</li> <li>{{t "The email will be forwarded to this stream" }}</li>
<li>{{#tr this}}The email subject will become the __page_params.product_name__ topic{{/tr}}</li> <li>{{#tr this}}The email subject will become the Zulip topic{{/tr}}</li>
<li>{{#tr this}}The email body will become the __page_params.product_name__ message{{/tr}}</li> <li>{{#tr this}}The email body will become the Zulip message{{/tr}}</li>
</ul> </ul>
</div> </div>

View File

@@ -5,7 +5,7 @@
</div> </div>
<form class="notification-settings-form"> <form class="notification-settings-form">
<div class="notification-reminder w-70 padded-container center-block">{{#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}}</div> <div class="notification-reminder w-70 padded-container center-block">{{#tr this }}You'll receive notifications when a message arrives and Zulip isn't in focus or the message is offscreen.{{/tr}}</div>
<div class="alert" id="notify-settings-status"></div> <div class="alert" id="notify-settings-status"></div>
<h4>{{t "Stream messages" }}</h4> <h4>{{t "Stream messages" }}</h4>

View File

@@ -1,7 +1,7 @@
{{! Contents of the "tutorial message" onboarding popup }} {{! Contents of the "tutorial message" onboarding popup }}
<div class="tutorial-popover popover-{{placement}}" id="tutorial-message"> <div class="tutorial-popover popover-{{placement}}" id="tutorial-message">
{{#tr this}}<p>Messages in __page_params.product_name__ go to a <b>stream</b> and have a <b>topic</b>.</p>{{/tr}} {{#tr this}}<p>Messages in Zulip go to a <b>stream</b> and have a <b>topic</b>.</p>{{/tr}}
<div class="tutorial-done-button"> <div class="tutorial-done-button">
<center> <center>

View File

@@ -7,7 +7,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
{% block title %} {% block title %}
{% if user_profile and user_profile.realm.name %} {% if user_profile and user_profile.realm.name %}
<title>{{user_profile.realm.name}} - {{product_name}}</title> <title>{{user_profile.realm.name}} - Zulip</title>
{% else %} {% else %}
<title>Zulip</title> <title>Zulip</title>
{% endif %} {% endif %}

View File

@@ -11,7 +11,7 @@
<div id="loading_more_messages_indicator"></div> <div id="loading_more_messages_indicator"></div>
<div id="page_loading_indicator"></div> <div id="page_loading_indicator"></div>
<div id="first_run_message" class="empty_feed_notice"> <div id="first_run_message" class="empty_feed_notice">
<h4>{% trans %}Welcome to {{product_name}}.{% endtrans %}</h4> <h4>{% trans %}Welcome to Zulip.{% endtrans %}</h4>
{% trans %} {% trans %}
<p>See, the thing about it is... there aren't any messages <p>See, the thing about it is... there aren't any messages
here for you right now. I'm sure someone will eventually send here for you right now. I'm sure someone will eventually send

View File

@@ -2,7 +2,7 @@
aria-labelledby="invite-user-label" aria-hidden="true"> aria-labelledby="invite-user-label" aria-hidden="true">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="invite-user-label">{% trans %}Invite users to {{product_name}}{% endtrans %}</h3> <h3 id="invite-user-label">{% trans %}Invite users to Zulip{% endtrans %}</h3>
</div> </div>
<form id="invite_user_form" class="form-horizontal" <form id="invite_user_form" class="form-horizontal"
action="/json/invite_users" method="POST">{{ csrf_input }} action="/json/invite_users" method="POST">{{ csrf_input }}

View File

@@ -62,19 +62,19 @@
<tr> <tr>
<td class="preserve_spaces">``` <td class="preserve_spaces">```
def zulip(): def zulip():
print "{{product_name}}" print "Zulip"
```</td> ```</td>
<td><pre>def zulip(): <td><pre>def zulip():
print "{{product_name}}"</pre></td> print "Zulip"</pre></td>
</tr> </tr>
<tr> <tr>
<td class="preserve_spaces">``` .py <td class="preserve_spaces">``` .py
def zulip(): def zulip():
print "{{product_name}}" print "Zulip"
```</td> ```</td>
<td> <td>
<div class="codehilite"><pre><span class="k">def</span> <span class="nf">zulip</span><span class="p">():</span> <div class="codehilite"><pre><span class="k">def</span> <span class="nf">zulip</span><span class="p">():</span>
<span class="k">print</span> <span class="s">"{{product_name}}"</span></pre></div> <span class="k">print</span> <span class="s">"Zulip"</span></pre></div>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@@ -110,7 +110,7 @@
</li> </li>
{% endif %} {% endif %}
{% if show_invites %} {% if show_invites %}
<li title="{% trans %}Invite more users to {{product_name}}.{% endtrans %}}"> <li title="{% trans %}Invite more users to Zulip.{% endtrans %}}">
<a href="#invite-user" role="button" data-toggle="modal"> <a href="#invite-user" role="button" data-toggle="modal">
<i class="icon-vector-plus-sign"></i> {{ _('Invite users') }} <i class="icon-vector-plus-sign"></i> {{ _('Invite users') }}
</a> </a>
@@ -118,7 +118,7 @@
<li class="divider"></li> <li class="divider"></li>
{% endif %} {% endif %}
{% if show_webathena %} {% if show_webathena %}
<li title="{% trans %}Grant {{product_name}} the Kerberos tickets needed to run your Zephyr mirror via Webathena{% endtrans %}" id="webathena_login_menu"> <li title="{% trans %}Grant Zulip the Kerberos tickets needed to run your Zephyr mirror via Webathena{% endtrans %}" id="webathena_login_menu">
<a href="#webathena" class="webathena_login"> <a href="#webathena" class="webathena_login">
<i class="icon-vector-bolt"></i>{{ _('Link with Webathena') }} <i class="icon-vector-bolt"></i>{{ _('Link with Webathena') }}
</a> </a>

View File

@@ -1,11 +1,11 @@
<div class="right-sidebar" id="right-sidebar"> <div class="right-sidebar" id="right-sidebar">
<div class="alert-box"> <div class="alert-box">
<div class="alert alert_sidebar alert-error home-error-bar" id="connection-error"> <div class="alert alert_sidebar alert-error home-error-bar" id="connection-error">
{% trans %}<strong>Unable to connect to {{ product_name }}.</strong> Updates may be delayed.{% endtrans %} {% trans %}<strong>Unable to connect to Zulip.</strong> Updates may be delayed.{% endtrans %}
<br /><br /> {{ _('Retrying soon...') }} <br /><br /> <a class="restart_get_updates_button">{{ _('Try now.') }}</a> <br /><br /> {{ _('Retrying soon...') }} <br /><br /> <a class="restart_get_updates_button">{{ _('Try now.') }}</a>
</div> </div>
<div class="alert alert_sidebar alert-error home-error-bar" id="get_old_messages_error"> <div class="alert alert_sidebar alert-error home-error-bar" id="get_old_messages_error">
{% trans %}<strong>Unable to connect to {{ product_name }}.</strong> Could not fetch messages.{% endtrans %} {% trans %}<strong>Unable to connect to Zulip.</strong> Could not fetch messages.{% endtrans %}
<br /><br /> {{ _('Retrying soon...') }} <br /><br /> <br /><br /> {{ _('Retrying soon...') }} <br /><br />
</div> </div>
<div class="alert alert_sidebar alert-error home-error-bar" id="zephyr-mirror-error"> <div class="alert alert_sidebar alert-error home-error-bar" id="zephyr-mirror-error">

View File

@@ -1,10 +1,10 @@
<div class="modal hide" id="tutorial-finale" tabindex="-1" role="dialog" <div class="modal hide" id="tutorial-finale" tabindex="-1" role="dialog"
aria-labelledby="tutorial-finale-label" aria-hidden="true"> aria-labelledby="tutorial-finale-label" aria-hidden="true">
<div class="modal-header"> <div class="modal-header">
<h3 id="tutorial-finale-label">{% trans %}Welcome to {{ product_name }}{% endtrans %}</h3> <h3 id="tutorial-finale-label">{% trans %}Welcome to Zulip{% endtrans %}</h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>{% trans %}Streams, topics, and narrowing make {{ product_name }} conversations <p>{% trans %}Streams, topics, and narrowing make Zulip conversations
efficient and productive.{% endtrans %}</p> efficient and productive.{% endtrans %}</p>
<p>{% trans %}That's all there is to it, so let's get started!{% endtrans %}</p> <p>{% trans %}That's all there is to it, so let's get started!{% endtrans %}</p>

View File

@@ -2150,11 +2150,10 @@ def do_create_realm(string_id, name, restricted_to_domain=None,
realm.save(update_fields=['notifications_stream']) realm.save(update_fields=['notifications_stream'])
# Include a welcome message in this notifications stream # Include a welcome message in this notifications stream
product_name = "Zulip" content = """Hello, and welcome to Zulip!
content = """Hello, and welcome to %s!
This is a message on stream `%s` with the topic `welcome`. We'll use this stream for This is a message on stream `%s` with the topic `welcome`. We'll use this stream for
system-generated notifications.""" % (product_name, notifications_stream.name,) system-generated notifications.""" % (notifications_stream.name,)
msg = internal_prep_message(realm, settings.WELCOME_BOT, 'stream', msg = internal_prep_message(realm, settings.WELCOME_BOT, 'stream',
notifications_stream.name, "welcome", notifications_stream.name, "welcome",
content) content)

View File

@@ -92,7 +92,6 @@ class HomeTest(ZulipTestCase):
"people_list", "people_list",
"pm_content_in_desktop_notifications", "pm_content_in_desktop_notifications",
"poll_timeout", "poll_timeout",
"product_name",
"prompt_for_invites", "prompt_for_invites",
"realm_add_emoji_by_admins_only", "realm_add_emoji_by_admins_only",
"realm_allow_message_editing", "realm_allow_message_editing",

View File

@@ -158,7 +158,6 @@ class TemplateTestCase(ZulipTestCase):
shallow_tested=True, shallow_tested=True,
user_profile=user_profile, user_profile=user_profile,
user=user_profile, user=user_profile,
product_name='testing',
form=DummyForm( form=DummyForm(
full_name=get_form_value('John Doe'), full_name=get_form_value('John Doe'),
terms=get_form_value(True), terms=get_form_value(True),

View File

@@ -335,8 +335,6 @@ def home_real(request):
if user_profile.realm.invite_by_admins_only and not user_profile.is_realm_admin: if user_profile.realm.invite_by_admins_only and not user_profile.is_realm_admin:
show_invites = False show_invites = False
product_name = "Zulip"
page_params['product_name'] = product_name
request._log_data['extra'] = "[%s]" % (register_ret["queue_id"],) request._log_data['extra'] = "[%s]" % (register_ret["queue_id"],)
response = render_to_response('zerver/index.html', response = render_to_response('zerver/index.html',
{'user_profile': user_profile, {'user_profile': user_profile,
@@ -351,7 +349,6 @@ def home_real(request):
'show_webathena': user_profile.realm.webathena_enabled, 'show_webathena': user_profile.realm.webathena_enabled,
'enable_feedback': settings.ENABLE_FEEDBACK, 'enable_feedback': settings.ENABLE_FEEDBACK,
'embedded': narrow_stream is not None, 'embedded': narrow_stream is not None,
'product_name': product_name
}, },
request=request) request=request)
patch_cache_control(response, no_cache=True, no_store=True, must_revalidate=True) patch_cache_control(response, no_cache=True, no_store=True, must_revalidate=True)