Skip to content
This repository was archived by the owner on Apr 17, 2021. It is now read-only.

Commit fd58ac6

Browse files
desechojmcclell
authored andcommitted
Added Russian locale
1 parent 5409a6b commit fd58ac6

File tree

4 files changed

+73
-17
lines changed

4 files changed

+73
-17
lines changed
866 Bytes
Binary file not shown.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3+
# This file is distributed under the same license as the PACKAGE package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PACKAGE VERSION\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2017-04-22 04:23-0400\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: Anton Samarchyan <desecho@gmail.com>\n"
14+
"Language-Team: LANGUAGE <LL@li.org>\n"
15+
"Language: \n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: 8bit\n"
19+
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
20+
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
21+
22+
#: templates/bootstrap_pagination/pagination.html:12
23+
msgid "First Page"
24+
msgstr "Первая Страница"
25+
26+
#: templates/bootstrap_pagination/pagination.html:19
27+
#: templates/bootstrap_pagination/pagination.html:23
28+
#: templatetags/bootstrap_pagination.py:102
29+
#: templatetags/bootstrap_pagination.py:104
30+
msgid "Previous Page"
31+
msgstr "Предыдущая Страница"
32+
33+
#: templates/bootstrap_pagination/pagination.html:30
34+
msgid "Current Page"
35+
msgstr "Текущая Страница"
36+
37+
#: templates/bootstrap_pagination/pagination.html:34
38+
msgid "Page"
39+
msgstr "Страница"
40+
41+
#: templates/bootstrap_pagination/pagination.html:41
42+
#: templates/bootstrap_pagination/pagination.html:45
43+
#: templatetags/bootstrap_pagination.py:103
44+
#: templatetags/bootstrap_pagination.py:105
45+
msgid "Next Page"
46+
msgstr "Следующая Страница"
47+
48+
#: templates/bootstrap_pagination/pagination.html:52
49+
#: templates/bootstrap_pagination/pagination.html:56
50+
msgid "Last Page"
51+
msgstr "Последняя Страница"
52+
53+
msgid "of"
54+
msgstr "из"

bootstrap_pagination/templates/bootstrap_pagination/pagination.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,58 @@
1+
{% load i18n %}
12
{% load bootstrap_pagination %}
23
<ul class="pagination{% if size == "small" %} pagination-sm{% endif %}{% if size == "large" %} pagination-lg{% endif %} {{ extra_pagination_classes }}">
34
{% if show_first_last %}
45
{% if not page.has_previous %}
56
<li class="page-item disabled">
6-
<span class="page-link" aria-hidden="true" title="First Page">{{ first_label }}</span>
7+
<span class="page-link" aria-hidden="true" title="{% trans 'First Page' %}">{{ first_label }}</span>
78
</li>
89
{% else %}
910
<li class="page-item">
10-
<a class="page-link" aria-label="First Page" title="First Page" href="{{ first_page_url|default:"#"|escape }}"><span aria-hidden="true">{{first_label}}</span></a>
11+
<a class="page-link" aria-label="{% trans 'First Page' %}" title="{% trans 'First Page' %}" href="{{ first_page_url|default:"#"|escape }}"><span aria-hidden="true">{{first_label}}</span></a>
1112
</li>
1213
{% endif %}
1314
{% endif %}
1415
{% if show_prev_next %}
1516
{% if not page.has_previous %}
1617
<li class="page-item disabled">
17-
<span class="page-link" aria-hidden="true" title="Previous Page">{{ previous_label }}</span>
18+
<span class="page-link" aria-hidden="true" title="{% trans 'Previous Page' %}">{{ previous_label }}</span>
1819
</li>
1920
{% else %}
2021
<li class="page-item">
21-
<a class="page-link" aria-label="Previous Page" title="Previous Page" href="{{ previous_page_url|default:"#"|escape }}"><span aria-hidden="true">{{ previous_label }}</span></a>
22+
<a class="page-link" aria-label="{% trans 'Previous Page' %}" title="{% trans 'Previous Page' %}" href="{{ previous_page_url|default:"#"|escape }}"><span aria-hidden="true">{{ previous_label }}</span></a>
2223
</li>
2324
{% endif %}
2425
{% endif %}
2526
{% for pagenum, index_range, url in page_urls %}
2627
{% if page.number == pagenum %}
2728
<li class="page-item active">
28-
<span class="page-link" aria-label="Current Page" title="Current Page">{% if show_index_range %} {{ index_range }} {% else %} {{ pagenum }} {% endif %}</span>
29+
<span class="page-link" aria-label="{% trans 'Current Page' %}" title="{% trans 'Current Page' %}">{% if show_index_range %} {{ index_range }} {% else %} {{ pagenum }} {% endif %}</span>
2930
</li>
3031
{% else %}
3132
<li class="page-item">
32-
<a class="page-link" aria-label="Page {{ pagenum }} of {{ page.paginator.num_pages }}" title="Page {{ pagenum }} of {{ page.paginator.num_pages }}" href="{{ url|escape }}">{% if show_index_range %} {{ index_range }} {% else %} {{ pagenum }} {% endif %}</a>
33+
<a class="page-link" aria-label="{% trans 'Page' %} {{ pagenum }} {% trans 'of' %} {{ page.paginator.num_pages }}" title="{% trans 'Page' %} {{ pagenum }} {% trans 'of' %} {{ page.paginator.num_pages }}" href="{{ url|escape }}">{% if show_index_range %} {{ index_range }} {% else %} {{ pagenum }} {% endif %}</a>
3334
</li>
3435
{% endif %}
3536
{% endfor %}
3637
{% if show_prev_next %}
3738
{% if not page.has_next %}
3839
<li class="page-item disabled">
39-
<span class="page-link" aria-hidden="true" title="Next Page">{{ next_label }}</span>
40+
<span class="page-link" aria-hidden="true" title="{% trans 'Next Page' %}">{{ next_label }}</span>
4041
</li>
4142
{% else %}
4243
<li class="page-item">
43-
<a class="page-link" aria-label="Next Page" title="Next Page" href="{{ next_page_url|default:"#"|escape }}"><span aria-hidden="true">{{ next_label }}</span></a>
44+
<a class="page-link" aria-label="{% trans 'Next Page' %}" title="{% trans 'Next Page' %}" href="{{ next_page_url|default:"#"|escape }}"><span aria-hidden="true">{{ next_label }}</span></a>
4445
</li>
4546
{% endif %}
4647
{% endif %}
4748
{% if show_first_last %}
4849
{% if not page.has_next %}
4950
<li class="page-item disabled">
50-
<span class="page-link" aria-hidden="true" title="Last Page" >{{ last_label }}</span>
51+
<span class="page-link" aria-hidden="true" title="{% trans 'Last Page' %}" >{{ last_label }}</span>
5152
</li>
5253
{% else %}
5354
<li class="page-item">
54-
<a class="page-link" aria-label="Last Page" title="Last Page" href="{{ last_page_url|default:"#"|escape }}"><span aria-hidden="true">{{last_label}}</span></a>
55+
<a class="page-link" aria-label="{% trans 'Last Page' %}" title="{% trans 'Last Page' %}" href="{{ last_page_url|default:"#"|escape }}"><span aria-hidden="true">{{last_label}}</span></a>
5556
</li>
5657
{% endif %}
5758
{% endif %}

bootstrap_pagination/templatetags/bootstrap_pagination.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
from django.conf import settings
1111
from django.http import QueryDict
1212
from django.utils.html import mark_safe
13+
from django.utils.translation import ugettext_lazy as _
1314

1415

15-
# As of django 1.10, template rendering no longer accepts a context, but
16-
# instead accepts only accepts a dict. Up until django 1.8, a context was
16+
# As of django 1.10, template rendering no longer accepts a context, but
17+
# instead accepts only accepts a dict. Up until django 1.8, a context was
1718
# actually required. Fortunately Context takes a single dict parameter,
1819
# so for django >=1.9 we can get away with just passing a unit function.
1920
if django.VERSION < (1, 9, 0):
@@ -116,10 +117,10 @@ def render(self, context):
116117
except VariableDoesNotExist:
117118
kwargs[argname] = None
118119

119-
previous_label = mark_safe(kwargs.get("previous_label", "Previous Page"))
120-
next_label = mark_safe(kwargs.get("next_label", "Next Page"))
121-
previous_title = mark_safe(kwargs.get("previous_title", "Previous Page"))
122-
next_title = mark_safe(kwargs.get("next_title", "Next Page"))
120+
previous_label = mark_safe(kwargs.get("previous_label", _("Previous Page")))
121+
next_label = mark_safe(kwargs.get("next_label", _("Next Page")))
122+
previous_title = mark_safe(kwargs.get("previous_title", _("Previous Page")))
123+
next_title = mark_safe(kwargs.get("next_title", _("Next Page")))
123124

124125
url_view_name = kwargs.get("url_view_name", None)
125126
if url_view_name is not None:
@@ -241,7 +242,7 @@ def render(self, context):
241242
index_range = "%s-%s" % (1 + (curpage - 1) * page.paginator.per_page, len(page.paginator.object_list), )
242243
else:
243244
index_range = "%s-%s" % (1 + (curpage - 1) * page.paginator.per_page, curpage * page.paginator.per_page, )
244-
245+
245246
url = get_page_url(curpage, get_current_app(context), url_view_name, url_extra_args, url_extra_kwargs, url_param_name, url_get_params, url_anchor)
246247
page_urls.append((curpage, index_range, url))
247248

0 commit comments

Comments
 (0)