Commit 0cdffe69 by Őry Máté

dashboard: fix i18n bugs introduced by 577130c4

* renaming to __ prevent makemessages catching it
* non-lazy version would never work here
parent 31c0e744
...@@ -49,8 +49,9 @@ from django.views.generic.detail import SingleObjectMixin ...@@ -49,8 +49,9 @@ from django.views.generic.detail import SingleObjectMixin
from django.views.generic import (TemplateView, DetailView, View, DeleteView, from django.views.generic import (TemplateView, DetailView, View, DeleteView,
UpdateView, CreateView, ListView) UpdateView, CreateView, ListView)
from django.contrib import messages from django.contrib import messages
from django.utils.translation import ugettext as _, ugettext_noop from django.utils.translation import (
from django.utils.translation import ungettext as __ ugettext as _, ugettext_noop, ungettext_lazy
)
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.template import RequestContext from django.template import RequestContext
...@@ -1896,7 +1897,7 @@ class VmCreate(LoginRequiredMixin, TemplateView): ...@@ -1896,7 +1897,7 @@ class VmCreate(LoginRequiredMixin, TemplateView):
i.deploy.async(user=request.user) i.deploy.async(user=request.user)
if len(instances) > 1: if len(instances) > 1:
messages.success(request, __( messages.success(request, ungettext_lazy(
"Successfully created %(count)d VM.", # this should not happen "Successfully created %(count)d VM.", # this should not happen
"Successfully created %(count)d VMs.", len(instances)) % { "Successfully created %(count)d VMs.", len(instances)) % {
'count': len(instances)}) 'count': len(instances)})
...@@ -2327,7 +2328,7 @@ class VmMassDelete(LoginRequiredMixin, View): ...@@ -2327,7 +2328,7 @@ class VmMassDelete(LoginRequiredMixin, View):
except Exception as e: except Exception as e:
logger.error(e) logger.error(e)
success_message = __( success_message = ungettext_lazy(
"Mass delete complete, the following VM was deleted: %s.", "Mass delete complete, the following VM was deleted: %s.",
"Mass delete complete, the following VMs were deleted: %s.", "Mass delete complete, the following VMs were deleted: %s.",
len(names)) % u', '.join(names) len(names)) % u', '.join(names)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment