Skip to content

Many i18n improvements #2944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 17, 2017
8 changes: 6 additions & 2 deletions readthedocs/donate/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from django.db import models
from django.utils.crypto import get_random_string
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext_lazy as _, pgettext
from django.core.urlresolvers import reverse
from django.conf import settings

Expand Down Expand Up @@ -172,9 +172,13 @@ def report_html_text(self):


class BaseImpression(models.Model):

"""Statistics for tracking."""

date = models.DateField(_('Date'))
offers = models.IntegerField(_('Offer'), default=0)
views = models.IntegerField(_('View'), default=0)
views = models.IntegerField(
pgettext('View', 'Number of display on a screen that were sold'), default=0)
clicks = models.IntegerField(_('Clicks'), default=0)

class Meta:
Expand Down
6 changes: 5 additions & 1 deletion readthedocs/gold/templates/gold/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@

<h3> {% trans "Existing Projects" %} </h3>
<p>
You can adopt {{ gold_user.num_supported_projects }} projects with your subscription.
{% blocktrans count projects=gold_user.num_supported_projects %}
You can adopt one project with your subscription.
{% plural %}
You can adopt {{ projects }} projects with your subscription.
{% endblocktrans %}
</p>

<ul>
Expand Down
4 changes: 3 additions & 1 deletion readthedocs/gold/templates/gold/subscription_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ <h2>{% trans "Gold Subscription" %}</h2>

<h3>{% trans "Projects" %}</h3>
<p class="subscription-projects">
{% blocktrans with projects=golduser.num_supported_projects %}
{% blocktrans count projects=golduser.num_supported_projects %}
You can adopt one project with your subscription.
{% plural %}
You can adopt {{ projects }} projects with your subscription.
{% endblocktrans %}
</p>
Expand Down
6 changes: 3 additions & 3 deletions readthedocs/redirects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ class Meta:

def __unicode__(self):
if self.redirect_type == 'prefix':
return ugettext('Prefix Redirect: %s ->' % self.from_url)
return ugettext('Prefix Redirect:') + ' %s ->' % self.from_url
elif self.redirect_type == 'page':
return ugettext('Page Redirect: %s -> %s' % (
return ugettext('Page Redirect:') + ' %s -> %s' % (
self.from_url,
self.to_url))
self.to_url)
else:
return ugettext('Redirect: %s' % self.get_redirect_type_display())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
{% load i18n %}

{% block content %}
{% blocktrans %}
<p>
To complete setting up your account, please verify this email address by
going to:
{% trans "To verify your email address and finish setting up your account, please go to:" %}
</p>

<p>
<a href="{{ activate_url }}">{{ activate_url }}</a>
</p>

<p>
If you did not sign up for an account with Read the Docs, you can
disregard this email.
{% trans "If you did not sign up for an account with Read the Docs, you can disregard this email." %}
</p>
{% endblocktrans %}
{% endblock %}

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

{% load i18n %}

{% block content %}{% blocktrans %}
To verify your email address and finish setting up your account, please
go to:
{% block content %}
{% trans "To verify your email address and finish setting up your account, please go to:" %}

{{ activate_url }}

If you did not sign up for an account with Read the Docs, you can
disregard this email.
{% endblocktrans %}{% endblock %}
{% trans "If you did not sign up for an account with Read the Docs, you can disregard this email." %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@
{% load i18n %}

{% block content %}
{% blocktrans %}
<p>
A request has been made to reset your Read the Docs password. To confirm
this reset request, please go to:
{% trans "A request has been made to reset your Read the Docs password. To confirm
this reset request, please go to:" %}
</p>

<p>
<a href="{{ password_reset_url }}">{{ password_reset_url }}</a>
</p>

<p>
If you did not request to reset you password, you can disregard this email.
{% trans "If you did not request to reset you password, you can disregard this email." %}
</p>
{% endblocktrans %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

{% load i18n %}

{% block content %}{% blocktrans %}
A request has been made to reset your Read the Docs password. To confirm
this reset request, please go to:
{% block content %}
{% trans "A request has been made to reset your Read the Docs password. To confirm
this reset request, please go to:" %}

{{ password_reset_url }}

If you did not request to reset you password, you can disregard this email.
{% endblocktrans %}{% endblock %}
{% trans "If you did not request to reset you password, you can disregard this email." %}
{% endblock %}
2 changes: 1 addition & 1 deletion readthedocs/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="icon" type="image/png" href="{{ MEDIA_URL }}images/favicon.png">

<!-- title -->
<title>{% block title %}{% endblock %}{% block head_title %}{% endblock %} | {% block branding %}{% trans "Read the Docs" %} {% endblock %}</title>
<title>{% block title %}{% endblock %}{% block head_title %}{% endblock %} | {% block branding %}Read the Docs {% endblock %}</title>

<!-- css -->
<link rel="stylesheet" href="{{ MEDIA_URL }}css/core.css">
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/templates/core/email/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{% trans "Read the Docs" %}</title>
<title>Read the Docs</title>

<style type="text/css">
/* Styles */
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/templates/core/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="rtfd-header-title">
<h1>
{% comment %}Translators: Name of the website{% endcomment %}
<a href="{% url "homepage" %}">{% trans "Read the Docs" %}</a>
<a href="{% url "homepage" %}">Read the Docs</a>
</h1>
</div>
<!-- END header title -->
Expand Down Expand Up @@ -42,7 +42,7 @@ <h1>
</div>
{% endif %}
<!-- END header nav -->


</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/templates/core/home-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- BEGIN header title-->
<div class="home-header-title">
<h1>{% trans "Read the Docs" %}</h1>
<h1>Read the Docs</h1>
<p class="tagline">{% trans "Create, host, and browse documentation." %}</p>
</div>
<!-- END header title -->
Expand Down
6 changes: 4 additions & 2 deletions readthedocs/templates/core/project_bar_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,21 @@ <h1>
{% blocktrans %}
This repository doesn't have a valid webhook set up,
commits won't trigger new builds for this project.
{% endblocktrans %}
<br>
{% blocktrans %}
See <a href='{{ integrations_url }}'>your project integrations</a> for more information.
{% endblocktrans %}
</p>
{% endif %}

{% if project.skip %}
<p class="build-failure">
{% blocktrans %}
{% blocktrans %}
Your project is currently disabled for abuse of the system.
Please make sure it isn't using unreasonable amounts of resources or triggering lots of builds in a short amount of time.
Please <a href="https://github.com/rtfd/readthedocs.org/issues">file a ticket</a> to get your project re-enabled.
{% endblocktrans %}
{% endblocktrans %}
</p>
<br>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/templates/core/project_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h3>{% trans "Versions" %}</h3>
</a>
{% else %}
<a class="module-item-title" href="{{ version.project.get_builds_url }}">
{% blocktrans with version.slug as slug %} {{ slug }}{% endblocktrans %}
{{ slug }}
</a>
{% endif %}
{% if request.user|is_admin:project %}
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/templates/error_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<h1>
{% comment %}Translators: Name of the website{% endcomment %}
<a href="//{{ PRODUCTION_DOMAIN }}">
{% trans "Read the Docs" %}
Read the Docs
</a>
</h1>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ <h3>{% trans 'Send Email' %}</h3>
{% with extra_recipients=recipients|slice:"20:" %}
{% if extra_recipients|length > 0 %}
<li>
{% blocktrans with count=extra_recipients|length %}
And {{ count }} other recipients...
{% blocktrans count counter=extra_recipients|length %}
And 1 other recipient.
{% plural %}
And {{ counter }} other recipients...
{% endblocktrans %}
</li>
{% endif %}
Expand Down
10 changes: 5 additions & 5 deletions readthedocs/templates/projects/project_dashboard_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ <h3>{% trans "Projects" %}</h3>
{% else %}
<span class="right quiet">
<span class="build-count">
{% if builds == 1 %}
{% trans "1 build" %}
{% else %}
{{ builds }} {% trans "builds" %}
{% endif %}
{% blocktrans count counter=builds %}
1 build
{% plural %}
{{ builds }} builds
{% endblocktrans %}
</span>
{% with build=project.get_latest_build %}
{% if build.success %}
Expand Down
10 changes: 5 additions & 5 deletions readthedocs/templates/projects/project_import.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ <h1>{% trans "Import a Repository" %}</h1>
class="remote-repos-empty">
<li class="module-item">
{% if has_connected_accounts %}
{% blocktrans with binding='data-bind="click: sync_projects"' trimmed %}
<p>
<p>
{% blocktrans with binding='data-bind="click: sync_projects"' trimmed %}
No remote repositories found,
try <a href="#" {{ binding }}>refreshing your accounts</a>.
</p>
{% endblocktrans %}
{% endblocktrans %}
</p>
{% else %}
<p>
{% blocktrans trimmed %}
Expand Down Expand Up @@ -163,7 +163,7 @@ <h1>{% trans "Import a Repository" %}</h1>
data-bind="attr: {href: url}"
class="remote-repo-view"
title="{% trans "This repository has already been imported" %}">
<span>{% trans "View" %}</span>
<span>{% blocktrans context "verb, action to see in detail" %}"View"{% endblocktrans %}</span>
</a>
</li>
<li data-bind="visible: !match() && !is_locked()" style="display: none;">
Expand Down