Skip to content

Commit

Permalink
Mark strings for translation in templates/zerver
Browse files Browse the repository at this point in the history
In order to enable internationalization support in Zulip, and to use
Django internationalization tools, all strings in Zulip frontend needs
to be marked for translation.
  • Loading branch information
Ahmed Shibani authored and timabbott committed Nov 4, 2015
1 parent 47d8d78 commit 4f29cfe
Show file tree
Hide file tree
Showing 32 changed files with 388 additions and 371 deletions.
15 changes: 8 additions & 7 deletions templates/zerver/accounts_accept_terms.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
{% extends "zerver/portico_signup.html" %}

{% load i18n %}
{% comment %}
Allow the user to accept the terms, creating an email record of that fact.
{% endcomment %}

{% block for_you %}for {% if company_name %} {{company_name}} {% else %} __________ {% endif %} {% endblock %}
{% block portico_content %}

<p>(Welcome! We think you'll like it here.)</p>
<p>({% trans "Welcome! We think you'll like it here" %}.)</p>


<div class="pitch">
<hr/>
<p>You're almost there. We just need you to do one last thing.</p>
<h3>Accept the Zulip terms of service</h3>
<p>{% trans "You're almost there. We just need you to do one last thing" %}.</p>
<h3>{% trans "Accept the Zulip terms of service" %}</h3>
</div>

<form method="post" class="form-horizontal" id="registration" action="{% url 'zerver.views.accounts_accept_terms' %}">
{% csrf_token %}
<div class="control-group">
<label for="id_email" class="control-label">Email</label>
<label for="id_email" class="control-label">{% trans "Email" %}</label>
<div class="controls fakecontrol">
<p>{{ email }}</p>
</div>
</div>
<div class="control-group">
<label for="id_full_name" class="control-label">Your name</label>
<label for="id_full_name" class="control-label">{% trans "Your name" %}</label>
<div class="controls">
<input id="id_full_name" class="required" type="text" name="full_name"
value="{% if form.full_name.value %}{{ form.full_name.value }}{% endif %}"
Expand All @@ -50,7 +51,7 @@ <h3>Accept the Zulip terms of service</h3>
{% endcomment %}
<input id="id_terms" class="required" type="checkbox" name="terms"
{% if form.terms.value %}checked="checked"{% endif %} />
I agree to the <a href="/terms">Terms of Service</a>.
{% trans "I agree to the" %} <a href="/terms">{% trans "Terms of Service" %}</a>.
</label>
{% if form.terms.errors %}
{% for error in form.terms.errors %}
Expand Down
14 changes: 7 additions & 7 deletions templates/zerver/accounts_home.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "zerver/portico_signup.html" %}

{% load i18n %}
{# Home page for not logged-in users. #}

{# This is where we pitch the app and solicit signups. #}
Expand All @@ -16,14 +16,14 @@

<div class="register-form">
<p class="lead">
<div class="register-page-header">Let's get started…</div>
<div class="register-page-header">{% trans "Let's get started" %}</div>
</p>
<form class="form-inline" id="send_confirm" name="email_form"
action="{{ current_url }}" method="post">
{% csrf_token %}
<input type="text" class="email required" placeholder="Enter your work email address"
<input type="text" class="email required" placeholder="{% trans "Enter your work email address" %}"
id="email" name="email"/>
<input type="submit" class="btn btn-primary btn-large register-button" value="Sign up"/>
<input type="submit" class="btn btn-primary btn-large register-button" value="{% trans "Sign up" %}"/>
</form>
<div id="errors"></div>
{% if form.email.errors %}
Expand All @@ -32,11 +32,11 @@
{% endfor %}
{% endif %}

<div class="alert alert-pitch" id="company-email">Please use your
<div class="alert alert-pitch" id="company-email">{% blocktrans %}Please use your
company email address to sign up. Otherwise, we won’t be able to
connect you with your coworkers.</div>
connect you with your coworkers{% endblocktrans %}.</div>
<div class="register-google">
<a href="{% url 'zerver.views.start_google_oauth2' %}" class="zocial google register-google-button">Sign up with Google</a>
<a href="{% url 'zerver.views.start_google_oauth2' %}" class="zocial google register-google-button">{% trans "Sign up with Google" %}</a>
</div>
</div>

Expand Down
10 changes: 5 additions & 5 deletions templates/zerver/accounts_send_confirm.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{% extends "zerver/portico_signup.html" %}

{% load i18n %}
{# Displayed after a user attempts to sign up. #}

{% block portico_content %}
<div class="app portico-page">
<div class="app-main portico-page-container">
<h2>Thanks for signing up!</h2>
<p class="lead">Check your email so we can get started.</p>
<h2>{% trans "Thanks for signing up!" %}</h2>
<p class="lead">{% trans "Check your email so we can get started" %}.</p>

<p>Still no email? We can <a href="#" id="resend_email_link">resend it</a>.<br/>
<small>(Just in case, take a look at your Spam folder.)</small></p>
<p>{% blocktrans %}Still no email? We can <a href="#" id="resend_email_link">resend it</a>{% endblocktrans %}.<br/>
<small>({% trans "Just in case, take a look at your Spam folder" %}.)</small></p>
<form id="resend_confirm" action="/accounts/home/" method="post" style="position: absolute;">
{% csrf_token %}
<input type="hidden" class="email" id="email" value="{{ email }}" name="email"/>&nbsp;
Expand Down
54 changes: 27 additions & 27 deletions templates/zerver/apps.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{% extends "zerver/portico.html" %}

{% load i18n %}
{# API information page #}

{% block portico_content %}
<div class="apps-page-header">Do&nbsp;we&nbsp;have&nbsp;apps? App&#8209;solutely.</div>
<div class="apps-muted">Ok, I take it back, I'm sorry, please don't go.</div>
<div class="apps-page-header">{% blocktrans %}Do we have apps? Appsolutely.{% endblocktrans %}</div>
<div class="apps-muted">{% blocktrans %}Ok, I take it back, I'm sorry, please don't go.{% endblocktrans %}</div>

<h3 class="apps-instructions-header">Installation instructions</h3>
<h3 class="apps-instructions-header">{% blocktrans %}Installation instructions{% endblocktrans %}</h3>
<ul class="nav nav-tabs" id="apps-tabs">
{% if not_voyager %}
<li class="active"><a href="#android" data-toggle="tab">Android</a></li>
Expand All @@ -23,10 +23,10 @@ <h3 class="apps-instructions-header">Installation instructions</h3>
<div class="tab-pane active" id="android">
<img class="screenshot android-screenshot pull-left" src="/static/images/app-screenshots/zulip-android.png" alt="screenshot of the Zulip app on Android" />

<p>Zulip has a free, <strong>100% native app</strong> for Android,
<p>{% blocktrans %}Zulip has a free, <strong>100% native app</strong> for Android,
and you can easily grab it from
the <a href="https://play.google.com/store/apps/details?id=com.zulip.android">Google
Play Store</a>.</p>
Play Store</a>{% endblocktrans %}.</p>

<a href="https://play.google.com/store/apps/details?id=com.zulip.android">
<img alt="Get it on Google Play"
Expand All @@ -37,9 +37,9 @@ <h3 class="apps-instructions-header">Installation instructions</h3>
<div class="tab-pane" id="iphone">
<img class="screenshot iphone-screenshot pull-left" src="/static/images/app-screenshots/zulip-iphone.png" alt="screenshot of the Zulip app on iOS" />

<p>Zulip has a free, <strong>100% native app</strong> for iPhone and
<p>{% blocktrans %}Zulip has a free, <strong>100% native app</strong> for iPhone and
iPad. Please grab it from
the <a href="http://itunes.com/apps/zulip">App Store</a>!</p>
the <a href="http://itunes.com/apps/zulip">App Store</a>{% endblocktrans %}!</p>

<a href="http://itunes.com/apps/zulip">
<img alt="Get it in the App Store" src="/static/images/app-screenshots/ios_badge.png" alt="Apple App Store icon for Zulip" />
Expand All @@ -48,29 +48,29 @@ <h3 class="apps-instructions-header">Installation instructions</h3>
</div>
{% endif %}
<div class="tab-pane" id="mac">
<p>You love your Mac. And you love Zulip. So what could be
<p>{% blocktrans %}You love your Mac. And you love Zulip. So what could be
better than a Zulip app for Mac? Enjoy notifications for
messages and PMs in your dock whether you're in Sublime,
emacs, or Photoshop.</p>
emacs, or Photoshop.{% endblocktrans %}</p>

<p style="text-align: center">
{% if not_voyager %}
<a href="https://zulip.com/dist/apps/mac/Zulip-latest.dmg" class="btn btn-large btn-primary btn-app-download"><i class="icon-vector-download"></i> Download Zulip for Mac</a>
<a href="https://zulip.com/dist/apps/mac/Zulip-latest.dmg" class="btn btn-large btn-primary btn-app-download"><i class="icon-vector-download"></i> {% blocktrans %}Download Zulip for Mac{% endblocktrans %}</a>
{% else %}
<a href="https://zulip.com/dist/apps/sso/mac/Zulip-latest.dmg" class="btn btn-large btn-primary btn-app-download"><i class="icon-vector-download"></i> Download Zulip for Mac</a>
<a href="https://zulip.com/dist/apps/sso/mac/Zulip-latest.dmg" class="btn btn-large btn-primary btn-app-download"><i class="icon-vector-download"></i> {% blocktrans %}Download Zulip for Mac{% endblocktrans %}</a>
{% endif %}
</p>

<img class="full-width-screenshot" src="/static/images/app-screenshots/zulip-desktop-mac.png" alt="screenshot of the Zulip app on OS X" />
</div>

<div class="tab-pane" id="linux">
<p>Zulip provides a native Linux app that runs standalone
<p>{% blocktrans %}Zulip provides a native Linux app that runs standalone
outside of your browser. How you install it depends on what
you're running:</p>
you're running:{% endblocktrans %}</p>

<h3>Debian and Ubuntu</h3>
We have an APT repository for Zulip, so adding and installing the app is easy:
<h3>{% blocktrans %}Debian and Ubuntu{% endblocktrans %}</h3>
{% blocktrans %}We have an APT repository for Zulip, so adding and installing the app is easy:{% endblocktrans %}
<div class="codehilite"><pre>wget https://zulip.com/dist/keys/user-apt.asc
cat user-apt.asc | sudo apt-key add -
sudo apt-add-repository http://apt.zulip.com/user/
Expand All @@ -83,40 +83,40 @@ <h3>Debian and Ubuntu</h3>



<h3>Other</h3>
<h3>{% trans "Other" %}</h3>
{% if not_voyager %}
<p>We provide a <a href="https://zulip.com/dist/apps/linux/zulip-desktop_latest.bin.tar.gz">binary tarball</a> of the Zulip application, built for 64-bit systems.
<p>{% blocktrans %}We provide a <a href="https://zulip.com/dist/apps/linux/zulip-desktop_latest.bin.tar.gz">binary tarball</a> of the Zulip application, built for 64-bit systems.{% endblocktrans %}
</p>
{% else %}
<p>We provide a <a href="https://zulip.com/dist/apps/sso/linux/zulip-desktop_latest.bin.tar.gz">binary tarball</a> of the Zulip application, built for 64-bit systems.
<p>{% blocktrans %}We provide a <a href="https://zulip.com/dist/apps/sso/linux/zulip-desktop_latest.bin.tar.gz">binary tarball</a> of the Zulip application, built for 64-bit systems.{% endblocktrans %}
</p>
{% endif %}
</div>

<div class="tab-pane" id="windows">
<p>Windows. It's the best OS for your needs: gaming,
<p>{% blocktrans %}Windows. It's the best OS for your needs: gaming,
coding, expense reports. But you always felt that something
was missing... until now.</p>
was missing... until now.{% endblocktrans %}</p>

<p>We proudly present <b>Zulip for Windows</b>: the second-best app for Windows on the market today (after
Solitaire, obviously.)</p>
<p>{% blocktrans %}We proudly present <b>Zulip for Windows</b>: the second-best app for Windows on the market today (after
Solitaire, obviously.){% endblocktrans %}</p>

<p style="text-align: center">
{% if not_voyager %}
<a href="https://zulip.com/dist/apps/win/zulip-latest.exe" class="btn btn-large btn-primary btn-app-download"><i class="icon-vector-download"></i> Download Zulip for Windows</a>
<a href="https://zulip.com/dist/apps/win/zulip-latest.exe" class="btn btn-large btn-primary btn-app-download"><i class="icon-vector-download"></i> {% blocktrans %}Download Zulip for Windows{% endblocktrans %}</a>
{% else %}
<a href="https://zulip.com/dist/apps/sso/win/zulip-latest.exe" class="btn btn-large btn-primary btn-app-download"><i class="icon-vector-download"></i> Download Zulip for Windows</a>
<a href="https://zulip.com/dist/apps/sso/win/zulip-latest.exe" class="btn btn-large btn-primary btn-app-download"><i class="icon-vector-download"></i> {% blocktrans %}Download Zulip for Windows{% endblocktrans %}</a>
{% endif %}
</p>

<img class="full-width-screenshot" src="/static/images/app-screenshots/zulip-desktop-windows.png" alt="screenshot of the Zulip app on Windows" />
</div>

<div class="tab-pane" id="plan9">
<p>First, connect to our hosted 9P filesystem
<p>{% blocktrans %}First, connect to our hosted 9P filesystem
at <code>plan9.zulip.com</code> and then... no, we're
totally kidding. There definitely isn't a version of Zulip
for Plan 9.</p>
for Plan 9.{% endblocktrans %}</p>
</div>


Expand Down
7 changes: 4 additions & 3 deletions templates/zerver/bankruptcy.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{% load i18n %}
<div class="modal hide" id="bankruptcy" tabindex="-1" role="dialog"
aria-labelledby="bankruptcy-label" aria-hidden="true">

<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="bankruptcy-label">Welcome back</h3>
<h3 id="bankruptcy-label">{% trans 'Welcome back' %}</h3>
</div>

<div id="bankruptcy-unread-count"></div>

<div class="modal-footer">
<button id="yes-bankrupt" class="bankruptcy_button btn btn-primary"
aria-hidden="true">Yes, please!</button>
aria-hidden="true">{% trans 'Yes, please!' %}</button>
<button id="no-bankrupt" class="bankruptcy_button btn btn-default"
data-dismiss="modal" aria-hidden="true">No, I'll catch up.</button>
data-dismiss="modal" aria-hidden="true">{% trans "No, I'll catch up" %}.</button>
</div>
</div>
8 changes: 4 additions & 4 deletions templates/zerver/closed_realm.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{% extends "zerver/portico.html" %}

{% load i18n %}
{% block portico_content %}

<h3>Closed realm</h3>
<h3>{% trans 'Closed realm' %}</h3>

<p>Hi there! Thank you for your interest in Zulip.</p>
<p>{% trans 'Hi there! Thank you for your interest in Zulip' %}.</p>

<p>The organization you are trying to join, {{ closed_domain_name }}, only allows users with e-mail addresses within the organization. Please ask for a new invite to an appropriate e-mail address.</p>
<p>{% blocktrans %}The organization you are trying to join, {{ closed_domain_name }}, only allows users with e-mail addresses within the organization. Please ask for a new invite to an appropriate e-mail address{% endblocktrans %}.</p>

{% endblock %}
Loading

0 comments on commit 4f29cfe

Please sign in to comment.