From 2cfe9717bdcd15a989d9c4a25207759b480b74b9 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 21 Feb 2017 02:13:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4?= =?UTF-8?q?=20ru?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- taskapp/forms.py | 3 +- taskapp/models.py | 49 ++++++++++--------- taskapp/templates/taskapp/add_edit_task.html | 25 +++++----- taskapp/templates/taskapp/ext.htm | 15 +++--- taskapp/templates/taskapp/footer_btns.html | 5 +- taskapp/templates/taskapp/tasklist.html | 27 +++++----- .../templates/taskapp/tasklist_active.html | 25 +++++----- taskapp/templates/taskapp/tasklist_all.html | 31 ++++++------ .../templates/taskapp/tasklist_finish.html | 25 +++++----- taskapp/templates/taskapp/tasklist_own.html | 25 +++++----- taskapp/templates/taskapp/view.html | 23 ++++----- taskapp/views.py | 9 ++-- 12 files changed, 137 insertions(+), 125 deletions(-) diff --git a/taskapp/forms.py b/taskapp/forms.py index de3eda3..45b2bf7 100644 --- a/taskapp/forms.py +++ b/taskapp/forms.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +from django.utils.translation import ugettext as _ from datetime import timedelta from django import forms from django.utils import timezone @@ -12,7 +13,7 @@ class TaskFrm(forms.ModelForm): exclude = ['time_of_create', 'author', 'recipients', 'device'] widgets = { 'descr': forms.TextInput(attrs={ - 'placeholder': 'Краткое описание', + 'placeholder': _('Short description'), 'class': "form-control", 'autofocus': '' }), diff --git a/taskapp/models.py b/taskapp/models.py index b925569..ba13ba4 100644 --- a/taskapp/models.py +++ b/taskapp/models.py @@ -3,45 +3,46 @@ from datetime import timedelta from django.db import models from django.conf import settings from django.utils import timezone +from django.utils.translation import ugettext as _ from abonapp.models import Abon from .handle import handle as task_handle TASK_PRIORITIES = ( - ('A', 'Высший'), - ('C', 'Средний'), - ('E', 'Низкий') + ('A', _('Higher')), + ('C', _('Average')), + ('E', _('Low')) ) TASK_STATES = ( - ('S', 'Новая'), - ('C', 'На выполнении'), - ('F', 'Выполнена') + ('S', _('New')), + ('C', _('In fulfilling')), + ('F', _('Completed')) ) TASK_TYPES = ( - ('na', 'не выбрано'), - ('yt', 'жёлтый треугольник'), - ('rc', 'красный крестик'), - ('ls', 'слабая скорость'), - ('cf', 'обрыв кабеля'), - ('cn', 'подключение'), - ('pf', 'переодическое пропадание'), - ('cr', 'настройка роутера'), - ('co', 'настроить onu'), - ('fc', 'обжать кабель'), - ('ot', 'другое') + ('na', _('not chosen')), + ('yt', _('yellow triangle')), + ('rc', _('red cross')), + ('ls', _('weak speed')), + ('cf', _('cable break')), + ('cn', _('connection')), + ('pf', _('periodic disappearance')), + ('cr', _('router setup')), + ('co', _('configure onu')), + ('fc', _('crimp cable')), + ('ot', _('other')) ) class ChangeLog(models.Model): task = models.ForeignKey('Task') ACT_CHOICES = ( - ('e', 'Изменение задачи'), - ('c', 'Создание задачи'), - ('d', 'Удаление задачи'), - ('f', 'Завершение задачи'), - ('b', 'Задача начата') + ('e', _('Change task')), + ('c', _('Create task')), + ('d', _('Delete task')), + ('f', _('Completing tasks')), + ('b', _('The task started')) ) act_type = models.CharField(max_length=1, choices=ACT_CHOICES) when = models.DateTimeField(auto_now_add=True) @@ -72,8 +73,8 @@ class Task(models.Model): db_table = 'task' ordering = ('-id',) permissions = ( - ('can_viewall', 'Доступ ко всем задачам'), - ('can_remind', 'Напоминания о задачах') + ('can_viewall', _('Access to all tasks')), + ('can_remind', _('Reminders of tasks')) ) def finish(self, current_user): diff --git a/taskapp/templates/taskapp/add_edit_task.html b/taskapp/templates/taskapp/add_edit_task.html index c18de01..b3d0e6a 100644 --- a/taskapp/templates/taskapp/add_edit_task.html +++ b/taskapp/templates/taskapp/add_edit_task.html @@ -1,17 +1,18 @@ {% extends request.is_ajax|yesno:'bajax.html,base.html' %} +{% load i18n %} {% block main %} {% include 'message_block.html' %}
-

Добавьте новую задачу

+

{% trans 'Add new task' %}

@@ -23,7 +24,7 @@ {% csrf_token %}
- +
@@ -31,7 +32,7 @@
- +
@@ -39,7 +40,7 @@
- +
@@ -47,7 +48,7 @@
- +
@@ -55,7 +56,7 @@
- +
@@ -71,7 +72,7 @@
- +
@@ -87,7 +88,7 @@
- +
{{ form.attachment }}{{ form.attachment.errors }} @@ -95,10 +96,10 @@
diff --git a/taskapp/templates/taskapp/ext.htm b/taskapp/templates/taskapp/ext.htm index fb826bb..c955a40 100644 --- a/taskapp/templates/taskapp/ext.htm +++ b/taskapp/templates/taskapp/ext.htm @@ -1,16 +1,17 @@ {% extends request.is_ajax|yesno:'bajax.html,base.html' %} +{% load i18n %} {% block main %} {% include 'message_block.html' %}