Commit 108cbd75 authored by PJ Janse van Rensburg's avatar PJ Janse van Rensburg

Merge branch 'translation-fix'

parents b065d72c 30ab3e77
......@@ -18,7 +18,7 @@ from wtforms.fields import HiddenField
from wtforms.fields.core import UnboundField
from wtforms.validators import ValidationError, InputRequired
from flask_admin.babel import gettext
from flask_admin.babel import gettext, ngettext
from flask_admin.base import BaseView, expose
from flask_admin.form import BaseForm, FormOpts, rules
......@@ -2204,7 +2204,11 @@ class BaseModelView(BaseView, ActionsMixin):
# message is flashed from within delete_model if it fails
if self.delete_model(model):
flash(gettext('Record was successfully deleted.'), 'success')
count = 1
flash(
ngettext('Record was successfully deleted.',
'%(count)s records were successfully deleted.',
count, count=count), 'success')
return redirect(return_url)
else:
flash_errors(form, message='Failed to delete record. %(error)s')
......
......@@ -31,7 +31,7 @@
{% elif csrf_token %}
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
{% endif %}
<button onclick="return safeConfirm('{{ _gettext('Are you sure you want to delete this record?') }}');" title="Delete record">
<button onclick="return safeConfirm('{{ _gettext('Are you sure you want to delete this record?') }}');" title="{{ _gettext('Delete record') }}">
<span class="fa fa-trash glyphicon glyphicon-trash"></span>
</button>
</form>
......
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 to comment