fix translation by using ugettext_lazy

This commit is contained in:
Oskar Hahn 2012-07-10 01:33:03 +02:00
parent 333349a1f2
commit 8d961f4940
18 changed files with 17 additions and 46 deletions

View File

@ -11,7 +11,7 @@
""" """
from django import forms from django import forms
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_lazy as _
from mptt.forms import TreeNodeChoiceField from mptt.forms import TreeNodeChoiceField

View File

@ -18,7 +18,7 @@ except ImportError:
from django.db import models from django.db import models
from django.core.urlresolvers import reverse 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 from mptt.models import MPTTModel, TreeForeignKey

View File

@ -10,7 +10,7 @@
:license: GNU GPL, see LICENSE for more details. :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(): def agenda_show():
from agenda.models import Item from agenda.models import Item

View File

@ -16,7 +16,7 @@ from django.core.urlresolvers import reverse
from django.contrib import messages from django.contrib import messages
from django.db import transaction from django.db import transaction
from django.db.models import Model 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 django.views.generic.detail import SingleObjectMixin
from openslides.utils.pdf import stylesheet from openslides.utils.pdf import stylesheet

View File

@ -12,7 +12,7 @@
from django import forms from django import forms
from django.contrib.auth.models import User 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.utils.forms import CssClassMixin
from openslides.application.models import Application from openslides.application.models import Application

View File

@ -17,7 +17,7 @@ from django.db.models import Max
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils.translation import pgettext 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 from openslides.utils.utils import _propper_unicode

View File

@ -34,7 +34,7 @@ from django.core.context_processors import csrf
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db import transaction from django.db import transaction
from django.shortcuts import redirect 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 import csv_ext
from openslides.utils.pdf import stylesheet from openslides.utils.pdf import stylesheet

View File

@ -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
"""}

View File

@ -14,7 +14,7 @@ from django import forms
from utils.forms import CssClassMixin from utils.forms import CssClassMixin
from models import config from models import config
from utils.translation_ext import ugettext as _ from utils.translation_ext import ugettext_lazy as _
class GeneralConfigForm(forms.Form, CssClassMixin): class GeneralConfigForm(forms.Form, CssClassMixin):

View File

@ -15,7 +15,7 @@ from django.core.urlresolvers import reverse
from django.db import models from django.db import models
from django.dispatch import receiver from django.dispatch import receiver
from django.utils.importlib import import_module 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.jsonfield import JSONField
from openslides.utils.signals import template_manipulation from openslides.utils.signals import template_manipulation

View File

@ -15,7 +15,7 @@ from django.contrib import messages
from django.contrib.auth.models import Group, Permission from django.contrib.auth.models import Group, Permission
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils.importlib import import_module 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 from openslides import get_version

View File

@ -13,7 +13,7 @@
from django import forms from django import forms
from django.contrib.auth.forms import AdminPasswordChangeForm from django.contrib.auth.forms import AdminPasswordChangeForm
from django.contrib.auth.models import User, Group, Permission 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.forms import CssClassMixin
from openslides.utils.translation_ext import LocalizedModelMultipleChoiceField from openslides.utils.translation_ext import LocalizedModelMultipleChoiceField

View File

@ -14,7 +14,7 @@ from django.contrib.auth.models import User
from django.db import models from django.db import models
from django.db.models import Q from django.db.models import Q
from django.dispatch import receiver 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 from openslides.config.signals import default_config_value

View File

@ -32,7 +32,7 @@ from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User, Group from django.contrib.auth.models import User, Group
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.shortcuts import redirect 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 import csv_ext
from openslides.utils.pdf import stylesheet from openslides.utils.pdf import stylesheet

View File

@ -13,7 +13,7 @@
from django import forms from django import forms
from utils.forms import CssClassMixin from utils.forms import CssClassMixin
from utils.translation_ext import ugettext as _ from utils.translation_ext import ugettext_lazy as _
from models import Vote from models import Vote

View File

@ -14,7 +14,7 @@ from django.db import models
from openslides.projector.api import register_slidemodel from openslides.projector.api import register_slidemodel
from openslides.projector.models import SlideMixin 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 from openslides.utils.modelfields import MinMaxIntegerField

View File

@ -12,7 +12,7 @@
from django.db import models from django.db import models
from django.dispatch import receiver 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 from openslides.config.signals import default_config_value

View File

@ -20,7 +20,7 @@ from django.db.models import Q
from django.dispatch import receiver from django.dispatch import receiver
from django.utils.datastructures import SortedDict from django.utils.datastructures import SortedDict
from django.utils.importlib import import_module 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.template import render_block_to_string, Tab
from openslides.utils.utils import html_strong from openslides.utils.utils import html_strong