From 6ae2d5ec48ed12ad1c2f090be9c3c25c443a68f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=D0=A0=D1=83=D1=81=D1=82=D0=B0=D0=BC=20=D0=9A=D0=B0=D1=88?= =?utf8?q?=D0=B0=D0=BF=D0=BE=D0=B2?= Date: Thu, 2 Oct 2014 20:40:46 +0400 Subject: [PATCH] i18n support and Russian language translation is added. --- .gitignore | 2 +- essay/models.py | 4 +- multichoice/locale/ru/LC_MESSAGES/django.mo | Bin 0 -> 1466 bytes multichoice/locale/ru/LC_MESSAGES/django.po | 72 +++ multichoice/models.py | 33 +- quiz/locale/ru/LC_MESSAGES/django.mo | Bin 0 -> 9271 bytes quiz/locale/ru/LC_MESSAGES/django.po | 459 ++++++++++++++++++++ quiz/models.py | 249 ++++++----- quiz/templates/base.html | 22 +- quiz/templates/correct_answer.html | 7 +- quiz/templates/progress.html | 23 +- quiz/templates/question.html | 13 +- quiz/templates/quiz/category_list.html | 5 +- quiz/templates/quiz/quiz_detail.html | 7 +- quiz/templates/quiz/quiz_list.html | 17 +- quiz/templates/quiz/sitting_detail.html | 23 +- quiz/templates/quiz/sitting_list.html | 19 +- quiz/templates/result.html | 23 +- quiz/templates/single_complete.html | 6 +- quiz/templates/view_quiz_category.html | 7 +- true_false/locale/ru/LC_MESSAGES/django.mo | Bin 0 -> 914 bytes true_false/locale/ru/LC_MESSAGES/django.po | 36 ++ true_false/models.py | 12 +- 23 files changed, 831 insertions(+), 208 deletions(-) create mode 100644 multichoice/locale/ru/LC_MESSAGES/django.mo create mode 100644 multichoice/locale/ru/LC_MESSAGES/django.po create mode 100644 quiz/locale/ru/LC_MESSAGES/django.mo create mode 100644 quiz/locale/ru/LC_MESSAGES/django.po create mode 100644 true_false/locale/ru/LC_MESSAGES/django.mo create mode 100644 true_false/locale/ru/LC_MESSAGES/django.po diff --git a/.gitignore b/.gitignore index 31d02e5..ca4c436 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,4 @@ build* /.coveragerc /coverage_html_report/ /htmlcov/ -/uploads/ \ No newline at end of file +/uploads/ diff --git a/essay/models.py b/essay/models.py index 9f0c5d1..102e68a 100644 --- a/essay/models.py +++ b/essay/models.py @@ -1,3 +1,4 @@ +from django.utils.translation import ugettext as _ from quiz.models import Question @@ -19,4 +20,5 @@ class Essay_Question(Question): return unicode(self.content) class Meta: - verbose_name = "Essay style question" + verbose_name = _("Essay style question") + verbose_name_plural = _("Essay style questions") diff --git a/multichoice/locale/ru/LC_MESSAGES/django.mo b/multichoice/locale/ru/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..0832d4291db81a517516cfd8516d5e6f0e87af37 GIT binary patch literal 1466 zcmbu6&u<$=6vqc>`QcK8S`L7acpL~+Xu__WR*@4ol#mvqn1<9vy|mS^JJ?I@88bU3 z1ohCQ2M(=N2?>b{LKSBu6Y9zh)a6f@y>RT`z=az^d}r6hDG?_|di$9-^L~8a?1Mx5 zzGhg@z+QsgfE|YY3G?gSM;Ln?tbtF1E8r90g)!xr9gyR^2fhG)4?Yjx8~eY3`{4f$ zJ_-H-`nrFCr@{S?GIk&PI_UcxMDWYti=fw50iOeF;34oLI0b$Rz6O2+z6bsaE`ta5 z7j@2$DZyuPZouQ<3EX7IMZHsjovs#L)Bqc#n zkw4B_VD(z(OEjm7gWP+TOTwkjKp+Zds(3Hw?tK zh1CWvmW68eL{svH6rBp4>`0SDLeY|Hwv)6)^Os}ElW&b_;qF@CEGxq~9qFl|c0@-zUcUR!TLn2Tw`aYx#y)s|FIGi-xJJA0v_ALhd60`kO%)IMeZ$a5L-1Xhv;zj=T&|cNZ{g}Vp N9aO+mW;ge~|KA4?ASM6+ literal 0 HcmV?d00001 diff --git a/multichoice/locale/ru/LC_MESSAGES/django.po b/multichoice/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 0000000..3a1deab --- /dev/null +++ b/multichoice/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,72 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# , 2014. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-02 16:35+0000\n" +"PO-Revision-Date: 2014-10-02 20:35+0400\n" +"Last-Translator: \n" +"Language-Team: American English \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 1.5\n" + +#: models.py:7 models.py:61 +msgid "Content" +msgstr "Содержание" + +#: models.py:8 +msgid "Random" +msgstr "Случайно" + +#: models.py:9 +msgid "None" +msgstr "Ничего" + +#: models.py:17 +msgid "The order in which multichoice answer options are displayed to the user" +msgstr "Порядок отображения вопросов" + +#: models.py:20 +msgid "Answer Order" +msgstr "Порядок вопросов" + +#: models.py:50 +msgid "Multiple Choice Question" +msgstr "Вопрос с несколькими вариантами ответов" + +#: models.py:51 +msgid "Multiple Choice Questions" +msgstr "Вопросы с несколькими вариантами ответов" + +#: models.py:55 +msgid "Question" +msgstr "Вопрос" + +#: models.py:59 +msgid "Enter the answer text that you want displayed" +msgstr "Введите текст ответа" + +#: models.py:65 +msgid "Is this a correct answer?" +msgstr "Это правильный ответ?" + +#: models.py:66 +msgid "Correct" +msgstr "Правильно" + +#: models.py:72 +msgid "Answer" +msgstr "Вопрос" + +#: models.py:73 +msgid "Answers" +msgstr "Вопросы" + diff --git a/multichoice/models.py b/multichoice/models.py index 4fed996..488014c 100644 --- a/multichoice/models.py +++ b/multichoice/models.py @@ -1,10 +1,12 @@ +from django.utils.translation import ugettext as _ from django.db import models from quiz.models import Question + ANSWER_ORDER_OPTIONS = ( - ('content', 'Content'), - ('random', 'Random'), - ('none', 'None'), + ('content', _('Content')), + ('random', _('Random')), + ('none', _('None')) ) @@ -12,9 +14,10 @@ class MCQuestion(Question): answer_order = models.CharField(max_length=30, null=True, blank=True, choices=ANSWER_ORDER_OPTIONS, - help_text="The order in which multichoice " - "answer options are displayed " - "to the user") + help_text=_("The order in which multichoice " + "answer options are displayed " + "to the user"), + verbose_name=_("Answer Order")) def check_if_correct(self, guess): answer = Answer.objects.get(id=guess) @@ -44,21 +47,27 @@ class MCQuestion(Question): return Answer.objects.get(id=guess).content class Meta: - verbose_name = "Multiple Choice Question" - verbose_name_plural = "Multiple Choice Questions" + verbose_name = _("Multiple Choice Question") + verbose_name_plural = _("Multiple Choice Questions") class Answer(models.Model): - question = models.ForeignKey(MCQuestion) + question = models.ForeignKey(MCQuestion, verbose_name=_("Question")) content = models.CharField(max_length=1000, blank=False, - help_text="Enter the answer text that " - "you want displayed") + help_text=_("Enter the answer text that " + "you want displayed"), + verbose_name=_("Content")) correct = models.BooleanField(blank=False, default=False, - help_text="Is this a correct answer?") + help_text=_("Is this a correct answer?"), + verbose_name=_("Correct")) def __unicode__(self): return unicode(self.content) + + class Meta: + verbose_name = _("Answer") + verbose_name_plural = _("Answers") diff --git a/quiz/locale/ru/LC_MESSAGES/django.mo b/quiz/locale/ru/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..2d6373ae34ebddd7dcdadd7ecf861121179269d9 GIT binary patch literal 9271 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 literal 0 HcmV?d00001 diff --git a/quiz/locale/ru/LC_MESSAGES/django.po b/quiz/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 0000000..b6910d1 --- /dev/null +++ b/quiz/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,459 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-01 18:01+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: models.py:26 models.py:33 models.py:48 models.py:77 models.py:536 +#: templates/progress.html:19 templates/quiz/quiz_detail.html:9 +#: templates/quiz/quiz_list.html:13 templates/quiz/sitting_detail.html:10 +msgid "Category" +msgstr "Категрия" + +#: models.py:34 +msgid "Categories" +msgstr "Категрии" + +#: models.py:43 models.py:53 models.py:541 +msgid "Sub-Category" +msgstr "Под-категория" + +#: models.py:54 +msgid "Sub-Categories" +msgstr "Под-категории" + +#: models.py:63 templates/quiz/quiz_list.html:12 +msgid "Title" +msgstr "Название" + +#: models.py:67 +msgid "Description" +msgstr "Описание" + +#: models.py:68 +msgid "a description of the quiz" +msgstr "описание теста" + +#: models.py:72 +msgid "a user friendly url" +msgstr "url теста" + +#: models.py:73 +msgid "user friendly url" +msgstr "url теста" + +#: models.py:81 +msgid "Random Order" +msgstr "Случайный порядок" + +#: models.py:82 +msgid "Display the questions in a random order or as they are set?" +msgstr "Отображать вопросы в случайном порядке или в порядке добавления?" + +#: models.py:87 +msgid "Max Questions" +msgstr "Максимальное количество вопросов" + +#: models.py:88 +msgid "Number of questions to be answered on each attempt." +msgstr "" +"Количество вопросов, на которые должны быть даны ответы при каждой попытке" + +#: models.py:92 +msgid "" +"Correct answer is NOT shown after question. Answers displayed at the end." +msgstr "" +"Правильный ответ НЕ показан после вопроса. Ответы отображаются после " +"прохождения теста" + +#: models.py:94 +msgid "Answers at end" +msgstr "Ответы в конце" + +#: models.py:98 +msgid "" +"If yes, the result of each attempt by a user will be stored. Necessary for " +"marking." +msgstr "Если отмечено, результаты каждой попытки пользователя будет сохранен" + +#: models.py:101 +msgid "Exam Paper" +msgstr "Экзаменационный лист" + +#: models.py:105 +msgid "" +"If yes, only one attempt by a user will be permitted. Non users cannot sit " +"this exam." +msgstr "Если отмечено, пользователю будет разрешена только одна попытка" + +#: models.py:108 +msgid "Single Attempt" +msgstr "Единственная попытка" + +#: models.py:112 +msgid "Percentage required to pass exam." +msgstr "Процент правльных ответов для прохождения теста" + +#: models.py:116 +msgid "Displayed if user passes." +msgstr "Отображается, если пользователь успешно прошел тест" + +#: models.py:117 +msgid "Success Text" +msgstr "Текст в случае успеха" + +#: models.py:120 +msgid "Fail Text" +msgstr "Текст в случае неудачи" + +#: models.py:121 +msgid "Displayed if user fails." +msgstr "Отображается, если пользователь провалил тест" + +#: models.py:125 +msgid "Draft" +msgstr "Черновик" + +#: models.py:126 +msgid "" +"If yes, the quiz is not displayed in the quiz list and can only be taken by " +"users who can edit quizzes." +msgstr "" + +#: models.py:146 models.py:364 models.py:532 +#: templates/quiz/sitting_list.html:14 +msgid "Quiz" +msgstr "Тест" + +#: models.py:147 +msgid "Quizzes" +msgstr "Тесты" + +#: models.py:186 models.py:362 templates/quiz/sitting_detail.html:13 +#: templates/quiz/sitting_list.html:13 +msgid "User" +msgstr "Пользователь" + +#: models.py:188 templates/progress.html:60 +#: templates/quiz/sitting_detail.html:15 templates/quiz/sitting_list.html:16 +msgid "Score" +msgstr "Баллы" + +#: models.py:193 +msgid "User Progress" +msgstr "Прогресс пользователя" + +#: models.py:194 +msgid "User progress records" +msgstr "Прогресс пользователя" + +#: models.py:254 +msgid "error" +msgstr "ошибка" + +#: models.py:254 +msgid "category does not exist or invalid score" +msgstr "категории не существует или недопустимый балл" + +#: models.py:367 +msgid "Question Order" +msgstr "Порядок вопросов" + +#: models.py:370 +msgid "Question List" +msgstr "Список вопросов" + +#: models.py:373 +msgid "Incorrect questions" +msgstr "Вопросы, на которые дан неверный ответ" + +#: models.py:375 +msgid "Current Score" +msgstr "Текущий балл" + +#: models.py:378 +msgid "Complete" +msgstr "Завершен" + +#: models.py:381 +msgid "User Answers" +msgstr "Ответы пользователя" + +#: models.py:384 +msgid "Start" +msgstr "Начало" + +#: models.py:386 +msgid "End" +msgstr "Окончание" + +#: models.py:391 +msgid "Can see completed exams." +msgstr "Может просматривать оконченные тесты" + +#: models.py:548 +msgid "Figure" +msgstr "Рисунок" + +#: models.py:552 +msgid "Enter the question text that you want displayed" +msgstr "Введите текст вопроса, который должен отобразиться" + +#: models.py:554 models.py:566 templates/question.html:47 +#: templates/quiz/sitting_detail.html:21 +msgid "Question" +msgstr "Вопрос" + +#: models.py:558 +msgid "Explanation to be shown after the question has been answered." +msgstr "Объяснение показывается после того, как дан ответ на вопрос" + +#: models.py:561 templates/question.html:32 templates/result.html:21 +#: templates/result.html.py:87 +msgid "Explanation" +msgstr "Объяснение" + +#: models.py:567 +msgid "Questions" +msgstr "Вопросы" + +#: templates/base.html:7 +msgid "Example Quiz Website" +msgstr "Тесты" + +#: templates/correct_answer.html:6 +msgid "You answered the above question incorrectly" +msgstr "Вы дали неверный ответ" + +#: templates/correct_answer.html:16 +msgid "This is the correct answer" +msgstr "Это правильный ответ" + +#: templates/correct_answer.html:23 +msgid "This was your answer." +msgstr "Это был ваш ответ" + +#: templates/progress.html:6 +msgid "Progress Page" +msgstr "Страница прогесса" + +#: templates/progress.html:7 +msgid "User Progress Page" +msgstr "Страница прогресса пользователя" + +#: templates/progress.html:13 +msgid "Question Category Scores" +msgstr "Баллы по категориям вопросов" + +#: templates/progress.html:20 +msgid "Correctly answererd" +msgstr "Верных ответов" + +#: templates/progress.html:21 +msgid "Incorrect" +msgstr "Неверных ответов" + +#: templates/progress.html:50 +msgid "Previous exam papers" +msgstr "Список предыдущих экзаменов" + +#: templates/progress.html:52 +msgid "Below are the results of exams that you have sat." +msgstr "Ниже представлены результаты пройденных Вами тестов" + +#: templates/progress.html:59 +msgid "Quiz Title" +msgstr "Название теста" + +#: templates/progress.html:61 +msgid "Possible Score" +msgstr "Возможный балл" + +#: templates/question.html:13 templates/result.html:13 +msgid "The previous question" +msgstr "Предыдущий вопрос" + +#: templates/question.html:22 +msgid "Your answer was" +msgstr "Ваш ответ был" + +#: templates/question.html:47 +msgid "of" +msgstr "из" + +#: templates/question.html:52 +msgid "Question category" +msgstr "Категория вопроса" + +#: templates/question.html:74 +msgid "Check" +msgstr "Ответить" + +#: templates/result.html:7 +msgid "Exam Results for" +msgstr "Результат теста для" + +#: templates/result.html:32 +msgid "Exam results" +msgstr "Результаты тестирования" + +#: templates/result.html:34 +msgid "Exam title" +msgstr "Название теста" + +#: templates/result.html:38 +msgid "You answered" +msgstr "Ваш результат" + +#: templates/result.html:38 +msgid "questions correctly out of" +msgstr "правильных ответов из" + +#: templates/result.html:38 +msgid "giving you" +msgstr "вы дали" + +#: templates/result.html:38 +msgid "percent correct" +msgstr "процент правльных ответов" + +#: templates/result.html:48 +msgid "Review the questions below and try the exam again in the future" +msgstr "" +"Просмотрите вопросы, представленные ниже и попробуйте пройти тест еще раз" + +#: templates/result.html:52 +msgid "" +"The result of this exam will be stored in your progress section so you can " +"review and monitor your progression" +msgstr "" +"Результаты данного экзамена будут сохранены. Вы сможете просматривать ваш " +"прогресс" + +#: templates/result.html:66 +msgid "Your session score is" +msgstr "Балл вашей сессии" + +#: templates/result.html:66 +msgid "out of a possible" +msgstr "из возможных" + +#: templates/result.html:84 +msgid "Your answer" +msgstr "Ваш ответ" + +#: templates/single_complete.html:13 +msgid "You have already sat this exam and only one sitting is permitted" +msgstr "Вы уже прошли данный тест. Разрешена только одна попытка" + +#: templates/single_complete.html:15 +msgid "This exam is only accessible to signed in users" +msgstr "Этот тест доступен только зарегистрированным пользователям" + +#: templates/view_quiz_category.html:3 +msgid "Quizzes related to" +msgstr "Тесты относятся к" + +#: templates/view_quiz_category.html:6 +msgid "Quizzes in the" +msgstr "Тесты в" + +#: templates/view_quiz_category.html:6 +msgid "category" +msgstr "категория" + +#: templates/view_quiz_category.html:20 +msgid "There are no quizzes" +msgstr "Тестов нет" + +#: templates/quiz/category_list.html:3 templates/quiz/quiz_list.html:3 +#: templates/quiz/sitting_list.html:3 +msgid "All Quizzes" +msgstr "Все тесты" + +#: templates/quiz/category_list.html:6 +msgid "Category list" +msgstr "Список категорий" + +#: templates/quiz/quiz_detail.html:11 +msgid "You will only get one attempt at this quiz" +msgstr "У вас есть одна попытка для прохождения данного теста" + +#: templates/quiz/quiz_detail.html:16 +msgid "Start quiz" +msgstr "Начать тест" + +#: templates/quiz/quiz_list.html:6 +msgid "List of quizzes" +msgstr "Список тестов" + +#: templates/quiz/quiz_list.html:14 +msgid "Exam" +msgstr "Тестирование" + +#: templates/quiz/quiz_list.html:15 +msgid "Single attempt" +msgstr "Единственная попытка" + +#: templates/quiz/quiz_list.html:31 templates/quiz/sitting_list.html:42 +msgid "View details" +msgstr "Подробнее" + +#: templates/quiz/quiz_list.html:41 +msgid "There are no available quizzes" +msgstr "Доступных тестов нет" + +#: templates/quiz/sitting_detail.html:5 +msgid "Result of" +msgstr "Результаты" + +#: templates/quiz/sitting_detail.html:5 +msgid "for" +msgstr "для" + +#: templates/quiz/sitting_detail.html:9 +msgid "Quiz title" +msgstr "Назвние теста" + +#: templates/quiz/sitting_detail.html:14 templates/quiz/sitting_list.html:15 +msgid "Completed" +msgstr "Завершено" + +#: templates/quiz/sitting_detail.html:22 +msgid "User answer" +msgstr "Ответ пользователя" + +#: templates/quiz/sitting_detail.html:41 +msgid "incorrect" +msgstr "Неверно" + +#: templates/quiz/sitting_detail.html:43 +msgid "Correct" +msgstr "Верно" + +#: templates/quiz/sitting_detail.html:49 +msgid "Toggle whether correct" +msgstr "Изменить результат" + +#: templates/quiz/sitting_list.html:6 +msgid "List of complete exams" +msgstr "Список завершенных тестов" + +#: templates/quiz/sitting_list.html:52 +msgid "There are no matching quizzes" +msgstr "Подходящих тестов нет" diff --git a/quiz/models.py b/quiz/models.py index b3592b0..0614787 100644 --- a/quiz/models.py +++ b/quiz/models.py @@ -4,6 +4,7 @@ import json from django.db import models from django.core.exceptions import ValidationError from django.core.validators import MaxValueValidator +from django.utils.translation import ugettext as _ from django.utils.timezone import now from model_utils.managers import InheritanceManager @@ -21,16 +22,16 @@ class CategoryManager(models.Manager): class Category(models.Model): - category = models.CharField(max_length=250, - blank=True, - unique=True, - null=True) + category = models.CharField( + verbose_name=_("Category"), + max_length=250, blank=True, + unique=True, null=True) objects = CategoryManager() class Meta: - verbose_name = "Category" - verbose_name_plural = "Categories" + verbose_name = _("Category") + verbose_name_plural = _("Categories") def __unicode__(self): return unicode(self.category) @@ -38,18 +39,19 @@ class Category(models.Model): class SubCategory(models.Model): - sub_category = models.CharField(max_length=250, - blank=True, - null=True) + sub_category = models.CharField( + verbose_name=_("Sub-Category"), + max_length=250, blank=True, null=True) + + category = models.ForeignKey( + Category, null=True, blank=True, + verbose_name=_("Category")) - category = models.ForeignKey(Category, - null=True, - blank=True) objects = CategoryManager() class Meta: - verbose_name = "Sub-Category" - verbose_name_plural = "Sub-Categories" + verbose_name = _("Sub-Category") + verbose_name_plural = _("Sub-Categories") def __unicode__(self): return unicode(self.sub_category + " (" + self.category.category + ")") @@ -57,73 +59,74 @@ class SubCategory(models.Model): class Quiz(models.Model): - title = models.CharField(max_length=60, - blank=False) - - description = models.TextField(blank=True, - help_text="a description of the quiz") - - url = models.SlugField(max_length=60, - blank=False, - help_text="a user friendly url", - verbose_name="user friendly url") - - category = models.ForeignKey(Category, - null=True, - blank=True) - - random_order = models.BooleanField(blank=False, - default=False, - help_text="Display the questions in " - "a random order or as they " - "are set?") - - max_questions = models.PositiveIntegerField(blank=True, - null=True, - help_text="Number of questions" - " to be answered on" - " each attempt.") - - answers_at_end = models.BooleanField(blank=False, - default=False, - help_text="Correct answer is NOT" - " shown after question." - " Answers displayed at" - " the end.") - - exam_paper = models.BooleanField(blank=False, - default=False, - help_text="If yes, the result of each" - " attempt by a user will be" - " stored. Necessary for" - " marking.") - - single_attempt = models.BooleanField(blank=False, - default=False, - help_text="If yes, only one attempt" - " by a user will be" - " permitted. Non users" - " cannot sit this exam.") - - pass_mark = models.SmallIntegerField(blank=True, - default=0, - help_text="Percentage required to" - " pass exam.", - validators=[ - MaxValueValidator(100)]) - - success_text = models.TextField(blank=True, - help_text="Displayed if user passes.") - - fail_text = models.TextField(blank=True, - help_text="Displayed if user fails.") - - draft = models.BooleanField(blank=True, - default=False, - help_text="If yes, the quiz is not displayed" - " in the quiz list and can only be" - " taken by users who can edit" - " quizzes.") + title = models.CharField( + verbose_name=_("Title"), + max_length=60, blank=False) + + description = models.TextField( + verbose_name=_("Description"), + blank=True, help_text=_("a description of the quiz")) + + url = models.SlugField( + max_length=60, blank=False, + help_text=_("a user friendly url"), + verbose_name=_("user friendly url")) + + category = models.ForeignKey( + Category, null=True, blank=True, + verbose_name=_("Category")) + + random_order = models.BooleanField( + blank=False, default=False, + verbose_name=_("Random Order"), + help_text=_("Display the questions in " + "a random order or as they " + "are set?")) + + max_questions = models.PositiveIntegerField( + blank=True, null=True, verbose_name=_("Max Questions"), + help_text=_("Number of questions to be answered on each attempt.")) + + answers_at_end = models.BooleanField( + blank=False, default=False, + help_text=_("Correct answer is NOT shown after question." + " Answers displayed at the end."), + verbose_name=_("Answers at end")) + + exam_paper = models.BooleanField( + blank=False, default=False, + help_text=_("If yes, the result of each" + " attempt by a user will be" + " stored. Necessary for marking."), + verbose_name=_("Exam Paper")) + + single_attempt = models.BooleanField( + blank=False, default=False, + help_text=_("If yes, only one attempt by" + " a user will be permitted." + " Non users cannot sit this exam."), + verbose_name=_("Single Attempt")) + + pass_mark = models.SmallIntegerField( + blank=True, default=0, + help_text=_("Percentage required to pass exam."), + validators=[MaxValueValidator(100)]) + + success_text = models.TextField( + blank=True, help_text=_("Displayed if user passes."), + verbose_name=_("Success Text")) + + fail_text = models.TextField( + verbose_name=_("Fail Text"), + blank=True, help_text=_("Displayed if user fails.")) + + draft = models.BooleanField( + blank=True, default=False, + verbose_name=_("Draft"), + help_text=_("If yes, the quiz is not displayed" + " in the quiz list and can only be" + " taken by users who can edit" + " quizzes.")) def save(self, force_insert=False, force_update=False, *args, **kwargs): self.url = re.sub('\s+', '-', self.url).lower() @@ -140,8 +143,8 @@ class Quiz(models.Model): super(Quiz, self).save(force_insert, force_update, *args, **kwargs) class Meta: - verbose_name = "Quiz" - verbose_name_plural = "Quizzes" + verbose_name = _("Quiz") + verbose_name_plural = _("Quizzes") def __unicode__(self): return unicode(self.title) @@ -180,15 +183,15 @@ class Progress(models.Model): Data stored in csv using the format: category, score, possible, category, score, possible, ... """ - user = models.OneToOneField("auth.User") + user = models.OneToOneField("auth.User", verbose_name=_("User")) - score = models.CommaSeparatedIntegerField(max_length=1024) + score = models.CommaSeparatedIntegerField(max_length=1024, verbose_name=_("Score")) objects = ProgressManager() class Meta: - verbose_name = "User Progress" - verbose_name_plural = "User progress records" + verbose_name = _("User Progress") + verbose_name_plural = _("User progress records") @property def list_all_cat_scores(self): @@ -248,7 +251,7 @@ class Progress(models.Model): possible_to_add, isinstance(score_to_add, int), isinstance(possible_to_add, int)]]): - return "error", "category does not exist or invalid score" + return _("error"), _("category does not exist or invalid score") to_find = re.escape(str(question.category)) +\ r",(?P\d+),(?P\d+)," @@ -260,9 +263,12 @@ class Progress(models.Model): updated_possible = int(match.group('possible')) +\ abs(possible_to_add) - new_score = (str(question.category) + "," + - str(updated_score) + "," + - str(updated_possible) + ",") + new_score = u",".join( + [ + unicode(question.category), + unicode(updated_score), + unicode(updated_possible), u"" + ]) # swap old score for the new one self.score = self.score.replace(match.group(), new_score) @@ -270,9 +276,13 @@ class Progress(models.Model): else: # if not present but existing, add with the points passed in - self.score += (str(question.category) + "," + - str(score_to_add) + "," + - str(possible_to_add) + ",") + self.score += u",".join( + [ + unicode(question.category), + unicode(score_to_add), + unicode(possible_to_add), + u"" + ]) self.save() def show_exams(self): @@ -345,31 +355,36 @@ class Sitting(models.Model): with the answer the user gave. """ - user = models.ForeignKey('auth.User') + user = models.ForeignKey('auth.User', verbose_name=_("User")) - quiz = models.ForeignKey(Quiz) + quiz = models.ForeignKey(Quiz, verbose_name=_("Quiz")) - question_order = models.CommaSeparatedIntegerField(max_length=1024) + question_order = models.CommaSeparatedIntegerField( + max_length=1024, verbose_name=_("Question Order")) - question_list = models.CommaSeparatedIntegerField(max_length=1024) + question_list = models.CommaSeparatedIntegerField( + max_length=1024, verbose_name=_("Question List")) - incorrect_questions = models.CommaSeparatedIntegerField(max_length=1024, - blank=True) + incorrect_questions = models.CommaSeparatedIntegerField( + max_length=1024, blank=True, verbose_name=_("Incorrect questions")) - current_score = models.IntegerField() + current_score = models.IntegerField(verbose_name=_("Current Score")) - complete = models.BooleanField(default=False, blank=False) + complete = models.BooleanField(default=False, blank=False, + verbose_name=_("Complete")) - user_answers = models.TextField(blank=True, default='{}') + user_answers = models.TextField(blank=True, default='{}', + verbose_name=_("User Answers")) - start = models.DateTimeField(auto_now_add=True) + start = models.DateTimeField(auto_now_add=True, + verbose_name=_("Start")) - end = models.DateTimeField(null=True, blank=True) + end = models.DateTimeField(null=True, blank=True, verbose_name=_("End")) objects = SittingManager() class Meta: - permissions = (("view_sittings", "Can see completed exams."),) + permissions = (("view_sittings", _("Can see completed exams.")),) def get_first_question(self): """ @@ -510,36 +525,42 @@ class Question(models.Model): """ quiz = models.ManyToManyField(Quiz, + verbose_name=_("Quiz"), blank=True) category = models.ForeignKey(Category, + verbose_name=_("Category"), blank=True, null=True) sub_category = models.ForeignKey(SubCategory, + verbose_name=_("Sub-Category"), blank=True, null=True) figure = models.ImageField(upload_to='uploads/%Y/%m/%d', blank=True, - null=True) + null=True, + verbose_name=_("Figure")) content = models.CharField(max_length=1000, blank=False, - help_text="Enter the question text that " - "you want displayed", - verbose_name='Question') + help_text=_("Enter the question text that " + "you want displayed"), + verbose_name=_('Question')) explanation = models.TextField(max_length=2000, blank=True, - help_text="Explanation to be shown " - "after the question has " - "been answered.", - verbose_name='Explanation') + help_text=_("Explanation to be shown " + "after the question has " + "been answered."), + verbose_name=_('Explanation')) objects = InheritanceManager() class Meta: + verbose_name = _("Question") + verbose_name_plural = _("Questions") ordering = ['category'] def __unicode__(self): diff --git a/quiz/templates/base.html b/quiz/templates/base.html index aa953aa..6b292e4 100644 --- a/quiz/templates/base.html +++ b/quiz/templates/base.html @@ -1,25 +1,37 @@ - +{% load i18n %} +{% load staticfiles %} -Example Quiz Website | {% block title %}{% endblock %} +{% trans "Example Quiz Website" %} | {% block title %}{% endblock %} - + - +{% if user.is_authenticated %} + +{% endif %}
diff --git a/quiz/templates/correct_answer.html b/quiz/templates/correct_answer.html index 49f7c36..d98a10d 100644 --- a/quiz/templates/correct_answer.html +++ b/quiz/templates/correct_answer.html @@ -1,8 +1,9 @@ +{% load i18n %} {% if previous.answers %} {% if user_was_incorrect %}
- You answered the above question incorrectly + {% trans "You answered the above question incorrectly" %}
{% endif %} @@ -12,14 +13,14 @@ {% if answer.correct %} {{ answer.content }} - This is the correct answer + {% trans "This is the correct answer" %} {% else %} {{ answer.content }} {% if previous.question_type.MCQuestion %} {% if answer.id|add:"0" == previous.previous_answer|add:"0" %} - This was your answer. + {% trans "This was your answer." %} {% endif %} {% endif %} diff --git a/quiz/templates/progress.html b/quiz/templates/progress.html index 34be020..5337c71 100644 --- a/quiz/templates/progress.html +++ b/quiz/templates/progress.html @@ -1,23 +1,24 @@ {% extends "base.html" %} +{% load i18n %} {% load quiz_tags %} -{% block title %} Progress Page {% endblock %} -{% block description %} User Progress Page {% endblock %} +{% block title %} {% trans "Progress Page" %} {% endblock %} +{% block description %} {% trans "User Progress Page" %} {% endblock %} {% block content %} {% if cat_scores %} -

Question Category Scores

+

{% trans "Question Category Scores" %}

- - - + + + @@ -46,18 +47,18 @@
-

Previous exam papers

+

{% trans "Previous exam papers" %}

- Below are the results of exams that you have sat. + {% trans "Below are the results of exams that you have sat." %}

CategoryCorrectly answererdIncorrect{% trans "Category" %}{% trans "Correctly answererd" %}{% trans "Incorrect" %} %
- - - + + + diff --git a/quiz/templates/question.html b/quiz/templates/question.html index 18d4a09..2a95b8f 100644 --- a/quiz/templates/question.html +++ b/quiz/templates/question.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load i18n%} {% load quiz_tags %} @@ -9,7 +10,7 @@ {% if previous.answers %} -

The previous question:

+

{% trans "The previous question" %}:

{{ previous.previous_question }}

{% if previous.previous_outcome %} @@ -18,7 +19,7 @@
{% endif %}

- Your answer was + {% trans "Your answer was" %} {{ previous.previous_outcome|yesno:"correct,incorrect" }} @@ -28,7 +29,7 @@ {% include 'correct_answer.html' %} -

Explanation:

+

{% trans "Explanation" %}:

{{ previous.previous_question.explanation }}

@@ -43,12 +44,12 @@ {% if progress %}
-Question {{ progress.0|add:1 }} of {{ progress.1 }} +{% trans "Question" %} {{ progress.0|add:1 }} {% trans "of" %} {{ progress.1 }}
{% endif %}

- Question category: + {% trans "Question category" %}: {{ question.category }}

@@ -70,7 +71,7 @@ Question {{ progress.0|add:1 }} of {{ progress.1 }} {% endfor %} - + {% endif %} diff --git a/quiz/templates/quiz/category_list.html b/quiz/templates/quiz/category_list.html index c58cd05..90ffe0a 100644 --- a/quiz/templates/quiz/category_list.html +++ b/quiz/templates/quiz/category_list.html @@ -1,8 +1,9 @@ {% extends 'base.html' %} -{% block title %}All Quizzes{% endblock %} +{% load i18n %} +{% block title %}{% trans "All Quizzes" %}{% endblock %} {% block content %} -

Category list

+

{% trans "Category list" %}

    {% for cat in category_list %} diff --git a/quiz/templates/quiz/quiz_detail.html b/quiz/templates/quiz/quiz_detail.html index b630341..2681f77 100644 --- a/quiz/templates/quiz/quiz_detail.html +++ b/quiz/templates/quiz/quiz_detail.html @@ -1,18 +1,19 @@ {% extends 'base.html' %} +{% load i18n %} {% block title %} {{ quiz.title }} {% endblock %} {% block content %}

    {{ quiz.title }}

    -

    Category: {{ quiz.category }}

    +

    {% trans "Category" %}: {{ quiz.category }}

    {% if quiz.single_attempt %} -

    You will only get one attempt at this quiz.

    +

    {% trans "You will only get one attempt at this quiz" %}.

    {% endif %}

    {{ quiz.description }}

    - Start quiz + {% trans "Start quiz" %}

    {% endblock %} diff --git a/quiz/templates/quiz/quiz_list.html b/quiz/templates/quiz/quiz_list.html index 4099581..2480c5d 100644 --- a/quiz/templates/quiz/quiz_list.html +++ b/quiz/templates/quiz/quiz_list.html @@ -1,17 +1,18 @@ {% extends 'base.html' %} -{% block title %}All Quizzes{% endblock %} +{% load i18n %} +{% block title %}{% trans "All Quizzes" %}{% endblock %} {% block content %} -

    List of quizzes

    +

    {% trans "List of quizzes" %}

    {% if quiz_list %}
Quiz TitleScorePossible Score{% trans "Quiz Title" %}{% trans "Score" %}{% trans "Possible Score" %} %
- - - - + + + + @@ -27,7 +28,7 @@ @@ -37,6 +38,6 @@
TitleCategoryExamSingle attempt{% trans "Title" %}{% trans "Category" %}{% trans "Exam" %}{% trans "Single attempt" %}
{{ quiz.single_attempt }} - View details + {% trans "View details" %}
{% else %} -

There are no available quizzes.

+

{% trans "There are no available quizzes" %}.

{% endif %} {% endblock %} diff --git a/quiz/templates/quiz/sitting_detail.html b/quiz/templates/quiz/sitting_detail.html index f8c1238..fe8da8c 100644 --- a/quiz/templates/quiz/sitting_detail.html +++ b/quiz/templates/quiz/sitting_detail.html @@ -1,24 +1,25 @@ {% extends 'base.html' %} +{% load i18n %} {% load quiz_tags %} {% block title %} -Result of {{ sitting.quiz.title }} for {{ sitting.user }} +{% trans "Result of" %} {{ sitting.quiz.title }} {% trans "for" %} {{ sitting.user }} {% endblock %} {% block content %} -

Quiz title: {{ sitting.quiz.title }}

-

Category: {{ sitting.quiz.category }}

+

{% trans "Quiz title" %}: {{ sitting.quiz.title }}

+

{% trans "Category" %}: {{ sitting.quiz.category }}

{{ sitting.quiz.description }}


-

User: {{ sitting.user }}

-

Completed: {{ sitting.end|date }}

-

Score: {{ sitting.get_percent_correct }}%

+

{% trans "User" %}: {{ sitting.user }}

+

{% trans "Completed" %}: {{ sitting.end|date }}

+

{% trans "Score" %}: {{ sitting.get_percent_correct }}%

- - + + @@ -37,15 +38,15 @@ Result of {{ sitting.quiz.title }} for {{ sitting.user }} diff --git a/quiz/templates/quiz/sitting_list.html b/quiz/templates/quiz/sitting_list.html index e838ee1..915c8a8 100644 --- a/quiz/templates/quiz/sitting_list.html +++ b/quiz/templates/quiz/sitting_list.html @@ -1,18 +1,19 @@ {% extends 'base.html' %} -{% block title %}All Quizzes{% endblock %} +{% load i18n %} +{% block title %}{% trans "All Quizzes" %}{% endblock %} {% block content %} -

List of complete exams

+

{% trans "List of complete exams" %}

{% if sitting_list %}
QuestionUser answer{% trans "Question" %}{% trans "User answer" %}
{{ question|answer_choice_to_string:question.user_answer }} {% if question.id in sitting.get_incorrect_questions %} -

incorrect

+

{% trans "incorrect" %}

{% else %} -

Correct

+

{% trans "Correct" %}

{% endif %}
{% csrf_token %} - +
- - - - + + + + @@ -24,7 +25,7 @@ - + @@ -38,7 +39,7 @@ @@ -48,6 +49,6 @@
UserQuizCompletedScore (%){% trans "User" %}{% trans "Quiz" %}{% trans "Completed" %}{% trans "Score" %}(%)
{{ sitting.get_percent_correct }} - View details + {% trans "View details" %}
{% else %} -

There are no matching quizzes.

+

{% trans "There are no matching quizzes" %}.

{% endif %} {% endblock %} diff --git a/quiz/templates/result.html b/quiz/templates/result.html index ea202a4..e99e793 100644 --- a/quiz/templates/result.html +++ b/quiz/templates/result.html @@ -1,15 +1,16 @@ {% extends "base.html" %} +{% load i18n %} {% load quiz_tags %} {% block title %} {{ quiz.title}} {% endblock %} -{% block description %} Exam Results for {{ quiz.title }} {% endblock %} +{% block description %} {% trans "Exam Results for" %} {{ quiz.title }} {% endblock %} {% block content %} {% if previous.answers %} -

The previous question:

+

{% trans "The previous question" %}:

{{ previous.previous_question }}

Your answer was @@ -17,7 +18,7 @@

{% include 'correct_answer.html' %} -

Explanation:

+

{% trans "Explanation" %}:

{{ previous.previous_question.explanation }}

@@ -28,13 +29,13 @@ {% if max_score %}
-

Exam results

+

{% trans "Exam results" %}

- Exam title: + {% trans "Exam title" %}: {{ quiz.title }}

- You answered {{ score }} questions correctly out of {{ max_score }}, giving you {{ percent }} percent correct + {% trans "You answered" %} {{ score }} {% trans "questions correctly out of" %} {{ max_score }}, {% trans "giving you" %} {{ percent }} {% trans "percent correct" %}

{% if quiz.pass_mark %} @@ -44,11 +45,11 @@ {% endif %} -

Review the questions below and try the exam again in the future.

+

{% trans "Review the questions below and try the exam again in the future"%}.

{% if user.is_authenticated %} -

The result of this exam will be stored in your progress section so you can review and monitor your progression.

+

{% trans "The result of this exam will be stored in your progress section so you can review and monitor your progression" %}.

{% endif %}
@@ -62,7 +63,7 @@ {% if possible %}

- Your session score is {{ session }} out of a possible {{ possible }} + {% trans "Your session score is" %} {{ session }} {% trans "out of a possible" %} {{ possible }}


@@ -80,10 +81,10 @@ {% correct_answer_for_all question %} {% if question.user_answer %} -

Your answer: {{ question|answer_choice_to_string:question.user_answer }}

+

{% trans "Your answer" %}: {{ question|answer_choice_to_string:question.user_answer }}

{% endif %} -

Explanation:

+

{% trans "Explanation" %}:

{{ question.explanation }}

diff --git a/quiz/templates/single_complete.html b/quiz/templates/single_complete.html index 6856a70..9b016f9 100644 --- a/quiz/templates/single_complete.html +++ b/quiz/templates/single_complete.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load i18n %} {% load quiz_tags %} @@ -9,10 +10,9 @@ {% if user.is_authenticated %} -

You have already sat this exam and only one sitting is permitted.

+

{% trans "You have already sat this exam and only one sitting is permitted" %}.

{% else %} -

This exam is only accessible to signed in users.

+

{% trans "This exam is only accessible to signed in users" %}.

{% endif %} - {% endblock %} diff --git a/quiz/templates/view_quiz_category.html b/quiz/templates/view_quiz_category.html index 067cbbb..29aeda6 100644 --- a/quiz/templates/view_quiz_category.html +++ b/quiz/templates/view_quiz_category.html @@ -1,8 +1,9 @@ {% extends 'base.html' %} -{% block title %}Quizzes related to {{ category.category }}{% endblock %} +{% load i18n %} +{% block title %}{% trans "Quizzes related to" %} {{ category.category }}{% endblock %} {% block content %} -

Quizzes in the {{ category.category }} category

+

{% trans "Quizzes in the" %} {{ category.category }} {% trans "category" %}

{% with object_list as quizzes %} {% if quizzes %} @@ -16,7 +17,7 @@ {% endfor %} {% else %} -

There are no quizzes

+

{% trans "There are no quizzes" %}

{% endif %} {% endwith %} {% endblock %} diff --git a/true_false/locale/ru/LC_MESSAGES/django.mo b/true_false/locale/ru/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..002a75ca190d36341511d0167295d4c7f9af1045 GIT binary patch literal 914 zcmaJ+!EVz)5M7`MDJKLRISdCHO1r5Y3RG@fY7(bJ*hxs;N^o=2O={}eVZEt9^gzl5 z)LuYv1ik>Ns#FQ7CHw(e{{RPmf-AF4Q9!B~>1p21yf-uZ$f^imc8Bs!gT9_F;>9RxwaRgWryvuUnFn@zVAYeK4qcv#799n*uupIHQ zKUr2B9vs_FswJe($lXkE|?{?b> z^Kr{2^TrGesCg~As%xgH!{{g| zs$DU49qxbzD987#ng7!&m{W=#IkbYV!RF?`f*NfMJvw^wV>1~dKcz3^uH2Ic>5lv= z`$T?Bx8$MRPq)$?Wcw3xZB=Ob)dFNYicjzxX%p7DhV& literal 0 HcmV?d00001 diff --git a/true_false/locale/ru/LC_MESSAGES/django.po b/true_false/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 0000000..8087300 --- /dev/null +++ b/true_false/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,36 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-01 17:56+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: models.py:9 +msgid "Tick this if the question is true. Leave it blank for false." +msgstr "Отметьте, если ответ на вопрос 'Да'. Оставьте пустым, если ответ 'Нет'" + +#: models.py:12 +msgid "Correct" +msgstr "Правльно" + +#: models.py:40 +msgid "True/False Question" +msgstr "Вопрос с ответом Да/Нет" + +#: models.py:41 +msgid "True/False Questions" +msgstr "Вопросы с ответом Да/Нет" diff --git a/true_false/models.py b/true_false/models.py index da79d6e..5b9c531 100644 --- a/true_false/models.py +++ b/true_false/models.py @@ -1,3 +1,4 @@ +from django.utils.translation import ugettext as _ from django.db import models from quiz.models import Question @@ -5,9 +6,10 @@ from quiz.models import Question class TF_Question(Question): correct = models.BooleanField(blank=False, default=False, - help_text="Tick this if the question " - "is true. Leave it blank for" - " false.") + help_text=_("Tick this if the question " + "is true. Leave it blank for" + " false."), + verbose_name=_("Correct")) def check_if_correct(self, guess): if guess == "True": @@ -35,6 +37,6 @@ class TF_Question(Question): return str(guess) class Meta: - verbose_name = "True/False Question" - verbose_name_plural = "True/False Questions" + verbose_name = _("True/False Question") + verbose_name_plural = _("True/False Questions") ordering = ['category'] -- 2.39.5