mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-05-15 18:53:18 +00:00
check i18n completeness
This commit is contained in:
parent
74573faf7a
commit
5ab4f33b6a
13 changed files with 30 additions and 29 deletions
|
|
@ -22,9 +22,9 @@ class BaseListAction(AdminModel2Mixin, TemplateView):
|
|||
|
||||
permission_classes = (permissions.IsStaffPermission,)
|
||||
|
||||
empty_message = 'Items must be selected in order to perform actions ' + \
|
||||
'on them. No items have been changed.'
|
||||
success_message = 'Successfully deleted %d %s'
|
||||
empty_message = _('Items must be selected in order to perform actions '
|
||||
'on them. No items have been changed.')
|
||||
success_message = _('Successfully deleted %(count)d %(items)s')
|
||||
|
||||
queryset = None
|
||||
|
||||
|
|
@ -98,9 +98,9 @@ class BaseListAction(AdminModel2Mixin, TemplateView):
|
|||
if request.POST.get('confirmed'):
|
||||
if self.process_queryset() is None:
|
||||
|
||||
message = _(self.success_message % (
|
||||
self.item_count, self.objects_name)
|
||||
)
|
||||
message = _(self.success_message % {
|
||||
'count': self.item_count, 'items': self.objects_name
|
||||
})
|
||||
messages.add_message(request, messages.INFO, message)
|
||||
|
||||
return None
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
{% extends "admin2/bootstrap/base.html" %}
|
||||
{% load admin2_tags i18n %}
|
||||
|
||||
{% block title %}Are you sure?{% endblock title %}
|
||||
{% block title %}{% trans "Are you sure?" %}{% endblock title %}
|
||||
|
||||
{% block page_title %}Are you sure?{% endblock page_title %}
|
||||
{% block page_title %}{% trans "Are you sure?" %}{% endblock page_title %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<li>
|
||||
<a href="{% url "admin2:dashboard" %}">Home</a>
|
||||
<a href="{% url "admin2:dashboard" %}">{% trans "Home" %}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{% block breadcrumbs %}
|
||||
<li>
|
||||
<a href="{% url "admin2:dashboard" %}">Home</a>
|
||||
<a href="{% url "admin2:dashboard" %}">{% trans "Home" %}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li class="active">{{ app_label|title }}</li>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
{% block breacrumbs %}{% endblock breacrumbs %}
|
||||
|
||||
{% block class_page_title %}span12 login-title{% endblock class_page_title %}
|
||||
{% block page_title %}{% trans "Site administration" %} - Login{% endblock page_title %}
|
||||
{% block page_title %}{% trans "Site administration" %} - {% trans "Login" %}{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row-fluid">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
{% block breadcrumbs %}
|
||||
<li>
|
||||
<a href="{% url "admin2:dashboard" %}">Home</a>
|
||||
<a href="{% url "admin2:dashboard" %}">{% trans "Home" %}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li class="active">{% trans "Logout" %}</li>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
{% block breadcrumbs %}
|
||||
<li>
|
||||
<a href="{% url "admin2:dashboard" %}">Home</a>
|
||||
<a href="{% url "admin2:dashboard" %}">{% trans "Home" %}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li class="active">{% trans "Password change successful" %}</li>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
{% block breadcrumbs %}
|
||||
<li>
|
||||
<a href="{% url "admin2:dashboard" %}">Home</a>
|
||||
<a href="{% url "admin2:dashboard" %}">{% trans "Home" %}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li class="active">{% trans "Password change" %} <span class="divider">/</span></li>
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<p>Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly.</p>
|
||||
<p>{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p>
|
||||
|
||||
{% if form.errors %}
|
||||
<p class="error-note">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>{% block title %}Site administration{% endblock title %} | django-admin2</title>
|
||||
<title>{% block title %}{% trans "Site administration" %}{% endblock title %} | django-admin2</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!-- Bootstrap -->
|
||||
{% block css %}
|
||||
|
|
@ -31,9 +31,7 @@
|
|||
{% if user.get_full_name %}
|
||||
{{ user.get_full_name }}
|
||||
{% else %}
|
||||
{% blocktrans with user=user.username %}
|
||||
Logged in as {{ user }}
|
||||
{% endblocktrans %}
|
||||
{% blocktrans with user=user.username %}Logged in as {{ user }}{% endblocktrans %}
|
||||
{% endif %}
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
|
|
@ -54,7 +52,7 @@
|
|||
{% block breacrumbs %}
|
||||
<ul class="breadcrumb">
|
||||
{% block breadcrumbs %}
|
||||
<li class="active">Home</li>
|
||||
<li class="active">{% trans "Home" %}</li>
|
||||
{% endblock breadcrumbs %}
|
||||
</ul>
|
||||
{% endblock breacrumbs %}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
{% block breadcrumbs %}
|
||||
<li>
|
||||
<a href="{% url "admin2:dashboard" %}">Home</a>
|
||||
<a href="{% url "admin2:dashboard" %}">{% trans "Home" %}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
{% block breadcrumbs %}
|
||||
<li>
|
||||
<a href="{% url "admin2:dashboard" %}">Home</a>
|
||||
<a href="{% url "admin2:dashboard" %}">{% trans "Home" %}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
{% block breadcrumbs %}
|
||||
<li>
|
||||
<a href="{% url "admin2:dashboard" %}">Home</a>
|
||||
<a href="{% url "admin2:dashboard" %}">{% trans "Home" %}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li>
|
||||
|
|
@ -28,8 +28,8 @@
|
|||
<div class="span12">
|
||||
<form method="get" class="form-search">
|
||||
<div class="input-append">
|
||||
<input type="text" class="input-medium search-query" placeholder="Search Term" name="q" value="{{search_term}}"/>
|
||||
<button class="btn" type="button"><i class="icon-search"></i> Search</button>
|
||||
<input type="text" class="input-medium search-query" placeholder="{% trans 'Search Term' %}" name="q" value="{{search_term}}"/>
|
||||
<button class="btn" type="button"><i class="icon-search"></i> {% trans "Search" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -55,7 +55,9 @@
|
|||
</ul>
|
||||
</div>
|
||||
<input type="hidden" name="action" value="" />
|
||||
<small class="muted"><span id="selected-count">0</span> of {{ object_list|length }} selected</small>
|
||||
<small class="muted">
|
||||
{% blocktrans with selected='<span id="selected-count">0</span>' total=object_list|length %}{{selected}} of {{total}} selected{% endblocktrans %}
|
||||
</small>
|
||||
<div class="pull-right">
|
||||
{% if permissions.has_add_permission %}
|
||||
<a href="{% url view|admin2_urlname:'create' %}" class="btn"><i class="icon-plus"></i> {% blocktrans with model_verbose_name=model|model_verbose_name %}Add {{ model_verbose_name }}{% endblocktrans %}</a>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
{% block breadcrumbs %}
|
||||
<li>
|
||||
<a href="{% url "admin2:dashboard" %}">Home</a>
|
||||
<a href="{% url "admin2:dashboard" %}">{% trans "Home" %}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from django.contrib.auth.views import (logout as auth_logout,
|
|||
login as auth_login)
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.urlresolvers import reverse, reverse_lazy
|
||||
from django.utils.translation import ugettext_lazy
|
||||
from django.db import models
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.utils.encoding import force_text
|
||||
|
|
@ -161,7 +162,7 @@ class ModelEditFormView(AdminModel2Mixin, Admin2ModelFormMixin, extra_views.Upda
|
|||
def get_context_data(self, **kwargs):
|
||||
context = super(ModelEditFormView, self).get_context_data(**kwargs)
|
||||
context['model'] = self.get_model()
|
||||
context['action'] = "Change"
|
||||
context['action'] = ugettext_lazy("Change")
|
||||
return context
|
||||
|
||||
|
||||
|
|
@ -175,7 +176,7 @@ class ModelAddFormView(AdminModel2Mixin, Admin2ModelFormMixin, extra_views.Creat
|
|||
def get_context_data(self, **kwargs):
|
||||
context = super(ModelAddFormView, self).get_context_data(**kwargs)
|
||||
context['model'] = self.get_model()
|
||||
context['action'] = "Add"
|
||||
context['action'] = ugettext_lazy("Add")
|
||||
return context
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue