Commit a30545c1 by Kálmán Viktor

dashboard: plural gettext for mass create / mass delete

parent 577130c4
......@@ -41,6 +41,7 @@ from django.views.generic import (TemplateView, DetailView, View, DeleteView,
UpdateView, CreateView, ListView)
from django.contrib import messages
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext as __
from django.template.defaultfilters import title as title_filter
from django.template.loader import render_to_string
from django.template import RequestContext
......@@ -1410,8 +1411,10 @@ class VmCreate(LoginRequiredMixin, TemplateView):
i.deploy.async(user=request.user)
if len(instances) > 1:
messages.success(request, _("Successfully created %d VMs." %
len(instances)))
messages.success(request, __(
"Successfully created %(count)d VM.", # this should not happen
"Successfully created %(count)d VMs.", len(instances)) % {
'count': len(instances)})
path = reverse("dashboard.index")
else:
messages.success(request, _("VM successfully created."))
......@@ -1844,8 +1847,10 @@ class VmMassDelete(LoginRequiredMixin, View):
except Exception as e:
logger.error(e)
success_message = _("Mass delete complete, the following VMs were "
"deleted: %s.") % u', '.join(names)
success_message = __(
"Mass delete complete, the following VM was deleted: %s.",
"Mass delete complete, the following VMs were deleted: %s.",
len(names)) % u', '.join(names)
# we can get this only via AJAX ...
if request.is_ajax():
......
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