diff --git a/survey/actions.py b/survey/actions.py index f0c42b7c..b9724922 100644 --- a/survey/actions.py +++ b/survey/actions.py @@ -1,5 +1,5 @@ from django.utils.translation import gettext_lazy as _ -from django.utils.translation import ungettext +from django.utils.translation import ngettext def make_published(modeladmin, request, queryset): @@ -7,7 +7,7 @@ def make_published(modeladmin, request, queryset): Mark the given survey as published """ count = queryset.update(is_published=True) - message = ungettext( + message = ngettext( "%(count)d survey was successfully marked as published.", "%(count)d surveys were successfully marked as published", count, diff --git a/survey/decorators.py b/survey/decorators.py index a5f1b242..3fb469ae 100644 --- a/survey/decorators.py +++ b/survey/decorators.py @@ -4,7 +4,7 @@ from django.contrib import messages from django.shortcuts import Http404, get_object_or_404, redirect, reverse -from django.utils.translation import ugettext +from django.utils.translation import gettext_lazy as _ from survey.models import Survey @@ -24,7 +24,7 @@ def survey_check(self, request, *args, **kwargs): if survey.expire_date < date.today(): msg = "Survey is not published anymore. It was published until: '%s'." logging.warning(msg, survey.expire_date) - messages.warning(request, ugettext("This survey has expired for new submissions.")) + messages.warning(request, _("This survey has expired for new submissions.")) return redirect(reverse("survey-list")) if survey.publish_date > date.today(): msg = "Survey is not yet published. It is due: '%s'." diff --git a/survey/exporter/tex/question2tex.py b/survey/exporter/tex/question2tex.py index 553e473e..811dd8b7 100755 --- a/survey/exporter/tex/question2tex.py +++ b/survey/exporter/tex/question2tex.py @@ -2,7 +2,7 @@ from django.conf import settings from django.utils.translation import gettext_lazy as _ -from django.utils.translation import ungettext +from django.utils.translation import ngettext from survey.models import Question @@ -60,7 +60,7 @@ def get_caption_min_cardinality(self): if self.min_cardinality > 0: caption += "{} {} ".format( _("with"), - ungettext( + ngettext( "%(min_cardinality)d respondents or more", "%(min_cardinality)d respondent or more", self.min_cardinality,