From 8d961f494081814a94da07004d4f23c99868d86c Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Tue, 10 Jul 2012 01:33:03 +0200 Subject: [PATCH] fix translation by using ugettext_lazy --- openslides/agenda/forms.py | 2 +- openslides/agenda/models.py | 2 +- openslides/agenda/slides.py | 2 +- openslides/agenda/views.py | 2 +- openslides/application/forms.py | 2 +- openslides/application/models.py | 2 +- openslides/application/views.py | 2 +- openslides/assignment/tests.py | 29 ----------------------------- openslides/config/forms.py | 2 +- openslides/config/models.py | 2 +- openslides/config/views.py | 2 +- openslides/participant/forms.py | 2 +- openslides/participant/models.py | 2 +- openslides/participant/views.py | 2 +- openslides/poll/forms.py | 2 +- openslides/poll/models.py | 2 +- openslides/projector/models.py | 2 +- openslides/projector/views.py | 2 +- 18 files changed, 17 insertions(+), 46 deletions(-) delete mode 100644 openslides/assignment/tests.py diff --git a/openslides/agenda/forms.py b/openslides/agenda/forms.py index c9cd348b2..12c62ccfa 100644 --- a/openslides/agenda/forms.py +++ b/openslides/agenda/forms.py @@ -11,7 +11,7 @@ """ from django import forms -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from mptt.forms import TreeNodeChoiceField diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index 532750c33..0c871dd99 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -18,7 +18,7 @@ except ImportError: from django.db import models from django.core.urlresolvers import reverse -from django.utils.translation import ugettext as _, ugettext_noop +from django.utils.translation import ugettext_lazy as _, ugettext_noop from mptt.models import MPTTModel, TreeForeignKey diff --git a/openslides/agenda/slides.py b/openslides/agenda/slides.py index 387eae8df..420ad8ba6 100644 --- a/openslides/agenda/slides.py +++ b/openslides/agenda/slides.py @@ -10,7 +10,7 @@ :license: GNU GPL, see LICENSE for more details. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ def agenda_show(): from agenda.models import Item diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index c690209c0..7fe19c4e9 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -16,7 +16,7 @@ from django.core.urlresolvers import reverse from django.contrib import messages from django.db import transaction from django.db.models import Model -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from django.views.generic.detail import SingleObjectMixin from openslides.utils.pdf import stylesheet diff --git a/openslides/application/forms.py b/openslides/application/forms.py index 972496400..4d397a895 100644 --- a/openslides/application/forms.py +++ b/openslides/application/forms.py @@ -12,7 +12,7 @@ from django import forms from django.contrib.auth.models import User -from django.utils.translation import ugettext as _, ugettext_noop +from django.utils.translation import ugettext_lazy as _, ugettext_noop from openslides.utils.forms import CssClassMixin from openslides.application.models import Application diff --git a/openslides/application/models.py b/openslides/application/models.py index 73f0c0c99..e17d84185 100644 --- a/openslides/application/models.py +++ b/openslides/application/models.py @@ -17,7 +17,7 @@ from django.db.models import Max from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.utils.translation import pgettext -from django.utils.translation import ugettext as _, ugettext_noop +from django.utils.translation import ugettext_lazy as _, ugettext_noop from openslides.utils.utils import _propper_unicode diff --git a/openslides/application/views.py b/openslides/application/views.py index 7c72fcaad..2d82fb9b2 100644 --- a/openslides/application/views.py +++ b/openslides/application/views.py @@ -34,7 +34,7 @@ from django.core.context_processors import csrf from django.core.urlresolvers import reverse from django.db import transaction from django.shortcuts import redirect -from django.utils.translation import ugettext as _, ungettext +from django.utils.translation import ugettext_lazy as _, ungettext from openslides.utils import csv_ext from openslides.utils.pdf import stylesheet diff --git a/openslides/assignment/tests.py b/openslides/assignment/tests.py deleted file mode 100644 index 31a7d746c..000000000 --- a/openslides/assignment/tests.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -""" - openslides.assignment.tests - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Unit tests for the assignment app. - - :copyright: 2011, 2012 by OpenSlides team, see AUTHORS. - :license: GNU GPL, see LICENSE for more details. -""" - -from django.test import TestCase - -#TODO: Replace these tests! -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/openslides/config/forms.py b/openslides/config/forms.py index 54e8c7187..80bec2f46 100644 --- a/openslides/config/forms.py +++ b/openslides/config/forms.py @@ -14,7 +14,7 @@ from django import forms from utils.forms import CssClassMixin from models import config -from utils.translation_ext import ugettext as _ +from utils.translation_ext import ugettext_lazy as _ class GeneralConfigForm(forms.Form, CssClassMixin): diff --git a/openslides/config/models.py b/openslides/config/models.py index 726bc1191..c4c6df33f 100644 --- a/openslides/config/models.py +++ b/openslides/config/models.py @@ -15,7 +15,7 @@ from django.core.urlresolvers import reverse from django.db import models from django.dispatch import receiver from django.utils.importlib import import_module -from django.utils.translation import ugettext as _, ugettext_noop +from django.utils.translation import ugettext_lazy as _, ugettext_noop from openslides.utils.jsonfield import JSONField from openslides.utils.signals import template_manipulation diff --git a/openslides/config/views.py b/openslides/config/views.py index 749d7dae0..3c4eaf76e 100644 --- a/openslides/config/views.py +++ b/openslides/config/views.py @@ -15,7 +15,7 @@ from django.contrib import messages from django.contrib.auth.models import Group, Permission from django.core.urlresolvers import reverse from django.utils.importlib import import_module -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from openslides import get_version diff --git a/openslides/participant/forms.py b/openslides/participant/forms.py index 6ee1ce58a..c9ab791da 100644 --- a/openslides/participant/forms.py +++ b/openslides/participant/forms.py @@ -13,7 +13,7 @@ from django import forms from django.contrib.auth.forms import AdminPasswordChangeForm from django.contrib.auth.models import User, Group, Permission -from django.utils.translation import ugettext as _, ugettext_noop +from django.utils.translation import ugettext_lazy as _, ugettext_noop from openslides.utils.forms import CssClassMixin from openslides.utils.translation_ext import LocalizedModelMultipleChoiceField diff --git a/openslides/participant/models.py b/openslides/participant/models.py index 231c78f40..17d95dea4 100644 --- a/openslides/participant/models.py +++ b/openslides/participant/models.py @@ -14,7 +14,7 @@ from django.contrib.auth.models import User from django.db import models from django.db.models import Q from django.dispatch import receiver -from django.utils.translation import ugettext as _, ugettext_noop +from django.utils.translation import ugettext_lazy as _, ugettext_noop from openslides.config.signals import default_config_value diff --git a/openslides/participant/views.py b/openslides/participant/views.py index 5d3c67bcd..2516d3499 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -32,7 +32,7 @@ from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User, Group from django.core.urlresolvers import reverse from django.shortcuts import redirect -from django.utils.translation import ugettext as _, ungettext +from django.utils.translation import ugettext_lazy as _, ungettext from openslides.utils import csv_ext from openslides.utils.pdf import stylesheet diff --git a/openslides/poll/forms.py b/openslides/poll/forms.py index 62e7541ba..5d688652f 100644 --- a/openslides/poll/forms.py +++ b/openslides/poll/forms.py @@ -13,7 +13,7 @@ from django import forms from utils.forms import CssClassMixin -from utils.translation_ext import ugettext as _ +from utils.translation_ext import ugettext_lazy as _ from models import Vote diff --git a/openslides/poll/models.py b/openslides/poll/models.py index bfdb29fce..347c90c12 100644 --- a/openslides/poll/models.py +++ b/openslides/poll/models.py @@ -14,7 +14,7 @@ from django.db import models from openslides.projector.api import register_slidemodel from openslides.projector.models import SlideMixin -from openslides.utils.translation_ext import ugettext as _ # TODO +from openslides.utils.translation_ext import ugettext_lazy as _ from openslides.utils.modelfields import MinMaxIntegerField diff --git a/openslides/projector/models.py b/openslides/projector/models.py index 040986fd7..0d108d282 100644 --- a/openslides/projector/models.py +++ b/openslides/projector/models.py @@ -12,7 +12,7 @@ from django.db import models from django.dispatch import receiver -from django.utils.translation import ugettext as _, ugettext_noop +from django.utils.translation import ugettext_lazy as _, ugettext_noop from openslides.config.signals import default_config_value diff --git a/openslides/projector/views.py b/openslides/projector/views.py index 5d6aa0456..4d7db7b8e 100644 --- a/openslides/projector/views.py +++ b/openslides/projector/views.py @@ -20,7 +20,7 @@ from django.db.models import Q from django.dispatch import receiver from django.utils.datastructures import SortedDict from django.utils.importlib import import_module -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from openslides.utils.template import render_block_to_string, Tab from openslides.utils.utils import html_strong