Skip to content

Commit daf0e3e

Browse files
committed
Localization
1 parent abf553d commit daf0e3e

File tree

7 files changed

+48
-7
lines changed

7 files changed

+48
-7
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ coverage.xml
4646
.hypothesis/
4747

4848
# Translations
49-
*.mo
5049
*.pot
5150

5251
# Django stuff:

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,12 @@ curl \
6060
-X POST -d '{"key": "<SECRET_KEY>", "status": true}' \
6161
http://<your_domain>/django_dev_protector/
6262
```
63+
64+
Localize
65+
--------
66+
The app template support Russian. You only need to switch Russian in settings.
67+
```
68+
LANGUAGE_CODE = 'ru-ru'
69+
70+
USE_I18N = True
71+
```
Binary file not shown.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Translation for django-dev-protector template.
2+
# Copyright (C) 2016 Manyakhin K.
3+
# This file is distributed under the same license as the django_dev_protector package.
4+
# Manyakhin K. [email protected], 2016.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: 0.3\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2016-11-14 18:33+0000\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: Manyakhin Konstantin [email protected]\n"
14+
"Language: Russian\n"
15+
"MIME-Version: 1.0\n"
16+
"Content-Type: text/plain; charset=UTF-8\n"
17+
"Content-Transfer-Encoding: 8bit\n"
18+
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
19+
"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n"
20+
"%100>=11 && n%100<=14)? 2 : 3);\n"
21+
22+
#: templates/django_dev_protector/index.html:6
23+
#: templates/django_dev_protector/index.html:9
24+
msgid "The work was not paid"
25+
msgstr "Работа не была оплачена"
26+
27+
#: templates/django_dev_protector/index.html:10
28+
msgid "Owner of this site has not paid to the developer"
29+
msgstr "Владелец данного сайта не заплатил разработчику"
30+
31+
#: templates/django_dev_protector/index.html:12
32+
msgid "In 10 seconds you will be redirected to another site"
33+
msgstr "Через 10 секунд вы будете перенаправлены на другой сайт"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
False
1+
True

django_dev_protector/templates/django_dev_protector/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
{% load i18n %}
12
<!DOCTYPE html>
23
<html>
34
<head>
45
<meta charset="utf-8">
5-
<title>The work was not paid</title>
6+
<title>{% trans "The work was not paid" %}</title>
67
</head>
78
<body>
8-
<h1>The work was not paid.</h1>
9-
<h3>Owner of this site has not paid to the developer</h3>
9+
<h1>{% trans "The work was not paid" %}.</h1>
10+
<h3>{% trans "Owner of this site has not paid to the developer" %}</h3>
1011
{% if redirect_url %}
11-
<h4>In 10 seconds you will be redirected to another site <a href="{{ redirect_url }}">{{ redirect_url }}</a></h4>
12+
<h4>{% trans "In 10 seconds you will be redirected to another site" %} <a href="{{ redirect_url }}">{{ redirect_url }}</a></h4>
1213
<script>
1314
setTimeout(function() {
1415
location.href = "{{ redirect_url }}";

test_app/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
ALLOWED_HOSTS = []
1111

12-
PROTECT_REDIRECT_URL = 'http://ya.ru'
1312

1413
INSTALLED_APPS = [
1514
'django.contrib.admin',

0 commit comments

Comments
 (0)