Rafał Pitoń 10 years ago
parent
commit
34ce1ecdb7

+ 9 - 7
misago/acl/views.py

@@ -43,7 +43,8 @@ class RoleFormMixin(object):
                 form.instance.permissions = new_permissions
                 form.instance.permissions = new_permissions
                 form.instance.save()
                 form.instance.save()
 
 
-                messages.success(request, self.message_submit % target.name)
+                messages.success(
+                    request, self.message_submit % {'name': target.name})
 
 
                 if 'stay' in request.POST:
                 if 'stay' in request.POST:
                     return redirect(request.path)
                     return redirect(request.path)
@@ -62,23 +63,24 @@ class RoleFormMixin(object):
 
 
 
 
 class NewRole(RoleFormMixin, RoleAdmin, generic.ModelFormView):
 class NewRole(RoleFormMixin, RoleAdmin, generic.ModelFormView):
-    message_submit = _('New role "%s" has been saved.')
+    message_submit = _('New role "%(name)s" has been saved.')
 
 
 
 
 class EditRole(RoleFormMixin, RoleAdmin, generic.ModelFormView):
 class EditRole(RoleFormMixin, RoleAdmin, generic.ModelFormView):
-    message_submit = _('Role "%s" has been changed.')
+    message_submit = _('Role "%(name)s" has been changed.')
 
 
 
 
 class DeleteRole(RoleAdmin, generic.ButtonView):
 class DeleteRole(RoleAdmin, generic.ButtonView):
     def check_permissions(self, request, target):
     def check_permissions(self, request, target):
         if target.special_role:
         if target.special_role:
-            message = _('Role "%s" is special role and can\'t be deleted.')
-            return message % target.name
+            message = _('Role "%(name)s" is special role '
+                        'and can\'t be deleted.')
+            return message % {'name': target.name}
 
 
     def button_action(self, request, target):
     def button_action(self, request, target):
         target.delete()
         target.delete()
-        message = _('Role "%s" has been deleted.') % unicode(target.name)
-        messages.success(request, message)
+        message = _('Role "%(name)s" has been deleted.')
+        messages.success(request, message % {'name': target.name})
 
 
 
 
 class RoleUsers(RoleAdmin, generic.TargetedView):
 class RoleUsers(RoleAdmin, generic.TargetedView):

+ 2 - 1
misago/admin/views/generic/formsbuttons.py

@@ -100,7 +100,8 @@ class ModelFormView(FormView):
     def handle_form(self, form, request, target):
     def handle_form(self, form, request, target):
         form.instance.save()
         form.instance.save()
         if self.message_submit:
         if self.message_submit:
-            messages.success(request, self.message_submit % target.name)
+            format = {'name': target.name}
+            messages.success(request, self.message_submit % format)
 
 
     def real_dispatch(self, request, target):
     def real_dispatch(self, request, target):
         FormType = self.create_form_type(request, target)
         FormType = self.create_form_type(request, target)

+ 2 - 2
misago/conf/views.py

@@ -47,8 +47,8 @@ def group(request, group_key):
 
 
             db_settings.flush_cache()
             db_settings.flush_cache()
 
 
-            messages.success(request,
-                             _('Changes in settings have been saved!'))
+            messages.success(
+                request, _('Changes in settings have been saved!'))
             return redirect('misago:admin:settings:group', group_key=group_key)
             return redirect('misago:admin:settings:group', group_key=group_key)
 
 
     use_single_form_template = (len(fieldsets) == 1 and
     use_single_form_template = (len(fieldsets) == 1 and

+ 9 - 9
misago/forums/views/forumsadmin.py

@@ -82,19 +82,19 @@ class ForumFormMixin(object):
                 RoleForumACL.objects.bulk_create(copied_acls)
                 RoleForumACL.objects.bulk_create(copied_acls)
 
 
         acl_version.invalidate()
         acl_version.invalidate()
-        messages.success(request, self.message_submit % target.name)
+        messages.success(request, self.message_submit % {'name': target.name})
 
 
 
 
 class NewForum(ForumFormMixin, ForumAdmin, generic.ModelFormView):
 class NewForum(ForumFormMixin, ForumAdmin, generic.ModelFormView):
-    message_submit = _('New forum "%s" has been saved.')
+    message_submit = _('New forum "%(name)s" has been saved.')
 
 
 
 
 class EditForum(ForumFormMixin, ForumAdmin, generic.ModelFormView):
 class EditForum(ForumFormMixin, ForumAdmin, generic.ModelFormView):
-    message_submit = _('Forum "%s" has been edited.')
+    message_submit = _('Forum "%(name)s" has been edited.')
 
 
 
 
 class DeleteForum(ForumAdmin, generic.ModelFormView):
 class DeleteForum(ForumAdmin, generic.ModelFormView):
-    message_submit = _('Forum "%s" has been deleted.')
+    message_submit = _('Forum "%(name)s" has been deleted.')
     template = 'delete.html'
     template = 'delete.html'
 
 
     def create_form_type(self, request, target):
     def create_form_type(self, request, target):
@@ -123,7 +123,7 @@ class DeleteForum(ForumAdmin, generic.ModelFormView):
 
 
         form.instance.delete()
         form.instance.delete()
 
 
-        messages.success(request, self.message_submit % target.name)
+        messages.success(request, self.message_submit % {'name': target.name})
         return redirect(self.root_link)
         return redirect(self.root_link)
 
 
 
 
@@ -138,8 +138,8 @@ class MoveDownForum(ForumAdmin, generic.ButtonView):
             Forum.objects.move_node(target, other_target, 'right')
             Forum.objects.move_node(target, other_target, 'right')
             Forum.objects.clear_cache()
             Forum.objects.clear_cache()
 
 
-            message = _('Forum "%s" has been moved below "%s".')
-            targets_names = (target.name, other_target.name)
+            message = _('Forum "%(name)s" has been moved below "%(other)s".')
+            targets_names = {'name': target.name, 'other': other_target.name}
             messages.success(request, message % targets_names)
             messages.success(request, message % targets_names)
 
 
 
 
@@ -154,6 +154,6 @@ class MoveUpForum(ForumAdmin, generic.ButtonView):
             Forum.objects.move_node(target, other_target, 'left')
             Forum.objects.move_node(target, other_target, 'left')
             Forum.objects.clear_cache()
             Forum.objects.clear_cache()
 
 
-            message = _('Forum "%s" has been moved above "%s".')
-            targets_names = (target.name, other_target.name)
+            message = _('Forum "%(name)s" has been moved above "%(other)s".')
+            targets_names = {'name': target.name, 'other': other_target.name}
             messages.success(request, message % targets_names)
             messages.success(request, message % targets_names)

+ 15 - 12
misago/forums/views/permsadmin.py

@@ -48,7 +48,8 @@ class RoleFormMixin(object):
                 form.instance.permissions = new_permissions
                 form.instance.permissions = new_permissions
                 form.instance.save()
                 form.instance.save()
 
 
-                messages.success(request, self.message_submit % target.name)
+                messages.success(
+                    request, self.message_submit % {'name': target.name})
 
 
                 if 'stay' in request.POST:
                 if 'stay' in request.POST:
                     return redirect(request.path)
                     return redirect(request.path)
@@ -67,23 +68,24 @@ class RoleFormMixin(object):
 
 
 
 
 class NewForumRole(RoleFormMixin, ForumRoleAdmin, generic.ModelFormView):
 class NewForumRole(RoleFormMixin, ForumRoleAdmin, generic.ModelFormView):
-    message_submit = _('New role "%s" has been saved.')
+    message_submit = _('New role "%(name)s" has been saved.')
 
 
 
 
 class EditForumRole(RoleFormMixin, ForumRoleAdmin, generic.ModelFormView):
 class EditForumRole(RoleFormMixin, ForumRoleAdmin, generic.ModelFormView):
-    message_submit = _('Role "%s" has been changed.')
+    message_submit = _('Role "%(name)s" has been changed.')
 
 
 
 
 class DeleteForumRole(ForumRoleAdmin, generic.ButtonView):
 class DeleteForumRole(ForumRoleAdmin, generic.ButtonView):
     def check_permissions(self, request, target):
     def check_permissions(self, request, target):
         if target.special_role:
         if target.special_role:
-            message = _('Role "%s" is special role and can\'t be deleted.')
-            return message % target.name
+            message = _('Role "%(name)s" is special '
+                        'role and can\'t be deleted.')
+            return message % {'name': target.name}
 
 
     def button_action(self, request, target):
     def button_action(self, request, target):
         target.delete()
         target.delete()
-        message = _('Role "%s" has been deleted.') % unicode(target.name)
-        messages.success(request, message)
+        message = _('Role "%(name)s" has been deleted.')
+        messages.success(request, message % {'name': target.name})
 
 
 
 
 """
 """
@@ -131,8 +133,8 @@ class ForumPermissions(ForumAdmin, generic.ModelFormView):
 
 
             acl_version.invalidate()
             acl_version.invalidate()
 
 
-            message = _("Forum %s permissions have been changed.")
-            messages.success(request, message % target)
+            message = _("Forum %(name)s permissions have been changed.")
+            messages.success(request, message % {'name': target.name})
             if 'stay' in request.POST:
             if 'stay' in request.POST:
                 return redirect(request.path)
                 return redirect(request.path)
             else:
             else:
@@ -145,7 +147,6 @@ class ForumPermissions(ForumAdmin, generic.ModelFormView):
                 'target': target,
                 'target': target,
             })
             })
 
 
-
 ForumsList.add_item_action(
 ForumsList.add_item_action(
     name=_("Forum permissions"),
     name=_("Forum permissions"),
     icon='fa fa-adjust',
     icon='fa fa-adjust',
@@ -202,8 +203,9 @@ class RoleForumsACL(RoleAdmin, generic.ModelFormView):
 
 
             acl_version.invalidate()
             acl_version.invalidate()
 
 
-            message = _("Forum permissions for role %s have been changed.")
-            messages.success(request, message % target)
+            message = _("Forum permissions for role "
+                        "%(name)s have been changed.")
+            messages.success(request, message % {'name': target.name})
             if 'stay' in request.POST:
             if 'stay' in request.POST:
                 return redirect(request.path)
                 return redirect(request.path)
             else:
             else:
@@ -215,6 +217,7 @@ class RoleForumsACL(RoleAdmin, generic.ModelFormView):
                 'forms': forms,
                 'forms': forms,
                 'target': target,
                 'target': target,
             })
             })
+
 RolesList.add_item_action(
 RolesList.add_item_action(
     name=_("Forums permissions"),
     name=_("Forums permissions"),
     icon='fa fa-comments-o',
     icon='fa fa-comments-o',

+ 144 - 105
misago/locale/en_US/LC_MESSAGES/django.po

@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-10-12 14:37+0000\n"
+"POT-Creation-Date: 2014-10-15 16:42+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -80,28 +80,28 @@ msgstr ""
 msgid "Requested role does not exist."
 msgid "Requested role does not exist."
 msgstr ""
 msgstr ""
 
 
-#: acl/views.py:53 forums/views/permsadmin.py:58
+#: acl/views.py:54 forums/views/permsadmin.py:59
 msgid "Form contains errors."
 msgid "Form contains errors."
 msgstr ""
 msgstr ""
 
 
-#: acl/views.py:65 forums/views/permsadmin.py:70
+#: acl/views.py:66 forums/views/permsadmin.py:71
 #, python-format
 #, python-format
-msgid "New role \"%s\" has been saved."
+msgid "New role \"%(name)s\" has been saved."
 msgstr ""
 msgstr ""
 
 
-#: acl/views.py:69 forums/views/permsadmin.py:74
+#: acl/views.py:70 forums/views/permsadmin.py:75
 #, python-format
 #, python-format
-msgid "Role \"%s\" has been changed."
+msgid "Role \"%(name)s\" has been changed."
 msgstr ""
 msgstr ""
 
 
-#: acl/views.py:75 forums/views/permsadmin.py:80
+#: acl/views.py:76 forums/views/permsadmin.py:81
 #, python-format
 #, python-format
-msgid "Role \"%s\" is special role and can't be deleted."
+msgid "Role \"%(name)s\" is special role and can't be deleted."
 msgstr ""
 msgstr ""
 
 
-#: acl/views.py:80 forums/views/permsadmin.py:85
+#: acl/views.py:82 forums/views/permsadmin.py:87
 #, python-format
 #, python-format
-msgid "Role \"%s\" has been deleted."
+msgid "Role \"%(name)s\" has been deleted."
 msgstr ""
 msgstr ""
 
 
 #: admin/admin.py:10 templates/misago/admin/index.html:5
 #: admin/admin.py:10 templates/misago/admin/index.html:5
@@ -970,48 +970,48 @@ msgstr ""
 
 
 #: forums/views/forumsadmin.py:89
 #: forums/views/forumsadmin.py:89
 #, python-format
 #, python-format
-msgid "New forum \"%s\" has been saved."
+msgid "New forum \"%(name)s\" has been saved."
 msgstr ""
 msgstr ""
 
 
 #: forums/views/forumsadmin.py:93
 #: forums/views/forumsadmin.py:93
 #, python-format
 #, python-format
-msgid "Forum \"%s\" has been edited."
+msgid "Forum \"%(name)s\" has been edited."
 msgstr ""
 msgstr ""
 
 
 #: forums/views/forumsadmin.py:97
 #: forums/views/forumsadmin.py:97
 #, python-format
 #, python-format
-msgid "Forum \"%s\" has been deleted."
+msgid "Forum \"%(name)s\" has been deleted."
 msgstr ""
 msgstr ""
 
 
 #: forums/views/forumsadmin.py:141
 #: forums/views/forumsadmin.py:141
 #, python-format
 #, python-format
-msgid "Forum \"%s\" has been moved below \"%s\"."
+msgid "Forum \"%(name)s\" has been moved below \"%(other)s\"."
 msgstr ""
 msgstr ""
 
 
 #: forums/views/forumsadmin.py:157
 #: forums/views/forumsadmin.py:157
 #, python-format
 #, python-format
-msgid "Forum \"%s\" has been moved above \"%s\"."
+msgid "Forum \"%(name)s\" has been moved above \"%(other)s\"."
 msgstr ""
 msgstr ""
 
 
-#: forums/views/permsadmin.py:134
+#: forums/views/permsadmin.py:136
 #, python-format
 #, python-format
-msgid "Forum %s permissions have been changed."
+msgid "Forum %(name)s permissions have been changed."
 msgstr ""
 msgstr ""
 
 
-#: forums/views/permsadmin.py:150
+#: forums/views/permsadmin.py:151
 msgid "Forum permissions"
 msgid "Forum permissions"
 msgstr ""
 msgstr ""
 
 
-#: forums/views/permsadmin.py:169 templates/misago/admin/forums/list.html:87
+#: forums/views/permsadmin.py:170 templates/misago/admin/forums/list.html:87
 msgid "No forums exist."
 msgid "No forums exist."
 msgstr ""
 msgstr ""
 
 
-#: forums/views/permsadmin.py:205
+#: forums/views/permsadmin.py:206
 #, python-format
 #, python-format
-msgid "Forum permissions for role %s have been changed."
+msgid "Forum permissions for role %(name)s have been changed."
 msgstr ""
 msgstr ""
 
 
-#: forums/views/permsadmin.py:219
+#: forums/views/permsadmin.py:222
 msgid "Forums permissions"
 msgid "Forums permissions"
 msgstr ""
 msgstr ""
 
 
@@ -1103,7 +1103,7 @@ msgid_plural "You have %(notifications)s new notifications"
 msgstr[0] ""
 msgstr[0] ""
 msgstr[1] ""
 msgstr[1] ""
 
 
-#: notifications/views.py:123 templates/misago/user_nav.html:88
+#: notifications/views.py:123 templates/misago/user_nav.html:82
 msgid "Your notifications"
 msgid "Your notifications"
 msgstr ""
 msgstr ""
 
 
@@ -1793,7 +1793,7 @@ msgstr ""
 #: templates/misago/ranks_online.html:14
 #: templates/misago/ranks_online.html:14
 #: templates/misago/thread/events.html:15
 #: templates/misago/thread/events.html:15
 #: templates/misago/thread/replies.html:36
 #: templates/misago/thread/replies.html:36
-#: templates/misago/threads/base.html:50 templates/misago/threads/base.html:54
+#: templates/misago/threads/base.html:52 templates/misago/threads/base.html:56
 #: templates/misago/users_cards.html:10
 #: templates/misago/users_cards.html:10
 #: templates/misago/userslists/active_posters.html:35
 #: templates/misago/userslists/active_posters.html:35
 #: templates/misago/userslists/base.html:45
 #: templates/misago/userslists/base.html:45
@@ -1903,7 +1903,7 @@ msgstr ""
 
 
 #: templates/misago/admin/warnings/list.html:44
 #: templates/misago/admin/warnings/list.html:44
 #: templates/misago/admin/warnings/list.html:62
 #: templates/misago/admin/warnings/list.html:62
-#: templates/misago/threads/base.html:97
+#: templates/misago/threads/base.html:106
 msgid "Moderated"
 msgid "Moderated"
 msgstr ""
 msgstr ""
 
 
@@ -1940,12 +1940,12 @@ msgstr ""
 msgid "Request has timed out."
 msgid "Request has timed out."
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/base.html:53
+#: templates/misago/base.html:52
 msgid "Unspecified error occured."
 msgid "Unspecified error occured."
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/base.html:54 templates/misago/base.html.py:55
-#: templates/misago/base.html:56 templates/misago/messages.html:20
+#: templates/misago/base.html:53 templates/misago/base.html.py:54
+#: templates/misago/base.html:55 templates/misago/messages.html:20
 #: templates/misago/register/form.html:79
 #: templates/misago/register/form.html:79
 #: templates/misago/register/form.html:112
 #: templates/misago/register/form.html:112
 msgid "Ok!"
 msgid "Ok!"
@@ -2443,7 +2443,7 @@ msgid "Advanced search"
 msgstr ""
 msgstr ""
 
 
 #: templates/misago/notifications/dropdown.html:7
 #: templates/misago/notifications/dropdown.html:7
-#: templates/misago/user_nav.html:86
+#: templates/misago/user_nav.html:80
 #, python-format
 #, python-format
 msgid "%(notifications)s new notification"
 msgid "%(notifications)s new notification"
 msgid_plural "%(notifications)s new notifications"
 msgid_plural "%(notifications)s new notifications"
@@ -2922,7 +2922,7 @@ msgid "Thread autor"
 msgstr ""
 msgstr ""
 
 
 #: templates/misago/thread/replies.html:43
 #: templates/misago/thread/replies.html:43
-#: templates/misago/threads/base.html:60
+#: templates/misago/threads/base.html:62
 #, python-format
 #, python-format
 msgid "%(replies)s reply"
 msgid "%(replies)s reply"
 msgid_plural "%(replies)s replies"
 msgid_plural "%(replies)s replies"
@@ -2930,7 +2930,7 @@ msgstr[0] ""
 msgstr[1] ""
 msgstr[1] ""
 
 
 #: templates/misago/thread/replies.html:49
 #: templates/misago/thread/replies.html:49
-#: templates/misago/threads/base.html:45
+#: templates/misago/threads/base.html:47
 #, python-format
 #, python-format
 msgid "Last post from %(last_post)s"
 msgid "Last post from %(last_post)s"
 msgstr ""
 msgstr ""
@@ -2956,61 +2956,66 @@ msgstr ""
 msgid "Thread has unread posts"
 msgid "Thread has unread posts"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/threads/base.html:49 templates/misago/threads/base.html:53
+#: templates/misago/threads/base.html:51 templates/misago/threads/base.html:55
 #, python-format
 #, python-format
 msgid "Last post by %(user)s"
 msgid "Last post by %(user)s"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/threads/base.html:66
+#: templates/misago/threads/base.html:68
 #, python-format
 #, python-format
 msgid "New thread with %(replies)s reply"
 msgid "New thread with %(replies)s reply"
 msgid_plural "New thread with %(replies)s replies"
 msgid_plural "New thread with %(replies)s replies"
 msgstr[0] ""
 msgstr[0] ""
 msgstr[1] ""
 msgstr[1] ""
 
 
-#: templates/misago/threads/base.html:73
+#: templates/misago/threads/base.html:75
 #, python-format
 #, python-format
 msgid "%(replies)s new reply"
 msgid "%(replies)s new reply"
 msgid_plural "%(replies)s new replies"
 msgid_plural "%(replies)s new replies"
 msgstr[0] ""
 msgstr[0] ""
 msgstr[1] ""
 msgstr[1] ""
 
 
-#: templates/misago/threads/base.html:82
+#: templates/misago/threads/base.html:83
+msgid "Thread location"
+msgstr ""
+
+#: templates/misago/threads/base.html:91
 msgid "Reported posts"
 msgid "Reported posts"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/threads/base.html:87 templates/misago/user_nav.html:72
+#: templates/misago/threads/base.html:96 templates/misago/user_nav.html:66
 msgid "Moderated posts"
 msgid "Moderated posts"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/threads/base.html:92
+#: templates/misago/threads/base.html:101
 msgid "Poll"
 msgid "Poll"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/threads/base.html:102
+#: templates/misago/threads/base.html:111
 msgid "Closed"
 msgid "Closed"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/threads/base.html:107
+#: templates/misago/threads/base.html:116
 #: templates/misago/userslists/online.html:42
 #: templates/misago/userslists/online.html:42
 msgid "Hidden"
 msgid "Hidden"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/threads/forum.html:5
+#: templates/misago/threads/forum.html:5 templates/misago/threads/new.html:5
+#: templates/misago/threads/unread.html:5
 #, python-format
 #, python-format
 msgid "Page %(page)s"
 msgid "Page %(page)s"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/threads/forum.html:74
+#: templates/misago/threads/forum.html:75
 msgid ""
 msgid ""
 "No threads matching criteria exist, or you don't have permission to see them."
 "No threads matching criteria exist, or you don't have permission to see them."
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/threads/forum.html:76
+#: templates/misago/threads/forum.html:77
 msgid "See all threads"
 msgid "See all threads"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/threads/forum.html:79
+#: templates/misago/threads/forum.html:80
 msgid ""
 msgid ""
 "No threads were posted in this forum, or you don't have permission to see "
 "No threads were posted in this forum, or you don't have permission to see "
 "them."
 "them."
@@ -3063,6 +3068,23 @@ msgstr ""
 msgid "Threads that will be moved:"
 msgid "Threads that will be moved:"
 msgstr ""
 msgstr ""
 
 
+#: templates/misago/threads/new.html:5 templates/misago/user_nav.html:34
+msgid "New threads"
+msgstr ""
+
+#: templates/misago/threads/new.html:12
+msgid "Threads you have never read"
+msgstr ""
+
+#: templates/misago/threads/new.html:36
+#, python-format
+msgid "There are no threads from last %(days)s day that you have never read."
+msgid_plural ""
+"There are no threads from last %(days)s days that you have you have never "
+"read."
+msgstr[0] ""
+msgstr[1] ""
+
 #: templates/misago/threads/reply_btn.html:5
 #: templates/misago/threads/reply_btn.html:5
 msgid "This forum is closed."
 msgid "This forum is closed."
 msgstr ""
 msgstr ""
@@ -3087,6 +3109,22 @@ msgstr ""
 msgid "Show threads:"
 msgid "Show threads:"
 msgstr ""
 msgstr ""
 
 
+#: templates/misago/threads/unread.html:5 templates/misago/user_nav.html:41
+msgid "Unread threads"
+msgstr ""
+
+#: templates/misago/threads/unread.html:12
+msgid "Threads with unread replies"
+msgstr ""
+
+#: templates/misago/threads/unread.html:36
+#, python-format
+msgid "There are no threads with unread replies from last %(days)s day."
+msgid_plural ""
+"There are no threads with unread replies from last %(days)s days."
+msgstr[0] ""
+msgstr[1] ""
+
 #: templates/misago/user_nav.html:13
 #: templates/misago/user_nav.html:13
 msgid "See your profile"
 msgid "See your profile"
 msgstr ""
 msgstr ""
@@ -3096,31 +3134,23 @@ msgstr ""
 msgid "Change options"
 msgid "Change options"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/user_nav.html:28
+#: templates/misago/user_nav.html:26
 msgid "See all notifications"
 msgid "See all notifications"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/user_nav.html:44
+#: templates/misago/user_nav.html:50
 msgid "Sign out"
 msgid "Sign out"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/user_nav.html:54
-msgid "New threads"
-msgstr ""
-
 #: templates/misago/user_nav.html:60
 #: templates/misago/user_nav.html:60
-msgid "Unread threads"
-msgstr ""
-
-#: templates/misago/user_nav.html:66
 msgid "Unresolved reports"
 msgid "Unresolved reports"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/user_nav.html:78
+#: templates/misago/user_nav.html:72
 msgid "Private threads"
 msgid "Private threads"
 msgstr ""
 msgstr ""
 
 
-#: templates/misago/user_nav.html:102
+#: templates/misago/user_nav.html:94
 msgid "Loading..."
 msgid "Loading..."
 msgstr ""
 msgstr ""
 
 
@@ -3506,27 +3536,27 @@ msgstr ""
 msgid "%(user)s merged in %(thread)s."
 msgid "%(user)s merged in %(thread)s."
 msgstr ""
 msgstr ""
 
 
-#: threads/moderation/threads.py:103
+#: threads/moderation/threads.py:101
 #, python-format
 #, python-format
 msgid "%(user)s approved thread."
 msgid "%(user)s approved thread."
 msgstr ""
 msgstr ""
 
 
-#: threads/moderation/threads.py:119
+#: threads/moderation/threads.py:117
 #, python-format
 #, python-format
 msgid "%(user)s opened thread."
 msgid "%(user)s opened thread."
 msgstr ""
 msgstr ""
 
 
-#: threads/moderation/threads.py:132
+#: threads/moderation/threads.py:130
 #, python-format
 #, python-format
 msgid "%(user)s closed thread."
 msgid "%(user)s closed thread."
 msgstr ""
 msgstr ""
 
 
-#: threads/moderation/threads.py:145
+#: threads/moderation/threads.py:143
 #, python-format
 #, python-format
 msgid "%(user)s made thread visible."
 msgid "%(user)s made thread visible."
 msgstr ""
 msgstr ""
 
 
-#: threads/moderation/threads.py:162
+#: threads/moderation/threads.py:160
 #, python-format
 #, python-format
 msgid "%(user)s hid thread."
 msgid "%(user)s hid thread."
 msgstr ""
 msgstr ""
@@ -3789,6 +3819,15 @@ msgstr ""
 msgid "With moderated posts"
 msgid "With moderated posts"
 msgstr ""
 msgstr ""
 
 
+#: threads/tests/test_newthreads_views.py:57 threads/views/newthreads.py:47
+msgid "You have to sign in to see your list of new threads."
+msgstr ""
+
+#: threads/tests/test_unreadthreads_view.py:46
+#: threads/views/unreadthreads.py:48
+msgid "You have to sign in to see your list of threads with unread replies."
+msgstr ""
+
 #: threads/validators.py:12
 #: threads/validators.py:12
 msgid "Enter thread title."
 msgid "Enter thread title."
 msgstr ""
 msgstr ""
@@ -3870,65 +3909,65 @@ msgstr[1] ""
 msgid "You have to select at least two threads to merge."
 msgid "You have to select at least two threads to merge."
 msgstr ""
 msgstr ""
 
 
-#: threads/views/generic/forum/actions.py:264
+#: threads/views/generic/forum/actions.py:266
 #, python-format
 #, python-format
 msgid "%(changed)d thread was merged into \"%(thread)s\"."
 msgid "%(changed)d thread was merged into \"%(thread)s\"."
 msgid_plural "%(changed)d threads were merged into \"%(thread)s\"."
 msgid_plural "%(changed)d threads were merged into \"%(thread)s\"."
 msgstr[0] ""
 msgstr[0] ""
 msgstr[1] ""
 msgstr[1] ""
 
 
-#: threads/views/generic/forum/actions.py:294
+#: threads/views/generic/forum/actions.py:296
 #, python-format
 #, python-format
 msgid "%(changed)d thread was closed."
 msgid "%(changed)d thread was closed."
 msgid_plural "%(changed)d threads were closed."
 msgid_plural "%(changed)d threads were closed."
 msgstr[0] ""
 msgstr[0] ""
 msgstr[1] ""
 msgstr[1] ""
 
 
-#: threads/views/generic/forum/actions.py:299
+#: threads/views/generic/forum/actions.py:301
 msgid "No threads were closed."
 msgid "No threads were closed."
 msgstr ""
 msgstr ""
 
 
-#: threads/views/generic/forum/actions.py:310
+#: threads/views/generic/forum/actions.py:312
 #, python-format
 #, python-format
 msgid "%(changed)d thread was opened."
 msgid "%(changed)d thread was opened."
 msgid_plural "%(changed)d threads were opened."
 msgid_plural "%(changed)d threads were opened."
 msgstr[0] ""
 msgstr[0] ""
 msgstr[1] ""
 msgstr[1] ""
 
 
-#: threads/views/generic/forum/actions.py:315
+#: threads/views/generic/forum/actions.py:317
 msgid "No threads were opened."
 msgid "No threads were opened."
 msgstr ""
 msgstr ""
 
 
-#: threads/views/generic/forum/actions.py:330
+#: threads/views/generic/forum/actions.py:332
 #, python-format
 #, python-format
 msgid "%(changed)d thread was made visible."
 msgid "%(changed)d thread was made visible."
 msgid_plural "%(changed)d threads were made visible."
 msgid_plural "%(changed)d threads were made visible."
 msgstr[0] ""
 msgstr[0] ""
 msgstr[1] ""
 msgstr[1] ""
 
 
-#: threads/views/generic/forum/actions.py:335
+#: threads/views/generic/forum/actions.py:337
 msgid "No threads were made visible."
 msgid "No threads were made visible."
 msgstr ""
 msgstr ""
 
 
-#: threads/views/generic/forum/actions.py:350
+#: threads/views/generic/forum/actions.py:352
 #, python-format
 #, python-format
 msgid "%(changed)d thread was hidden."
 msgid "%(changed)d thread was hidden."
 msgid_plural "%(changed)d threads were hidden."
 msgid_plural "%(changed)d threads were hidden."
 msgstr[0] ""
 msgstr[0] ""
 msgstr[1] ""
 msgstr[1] ""
 
 
-#: threads/views/generic/forum/actions.py:355
+#: threads/views/generic/forum/actions.py:357
 msgid "No threads were hidden."
 msgid "No threads were hidden."
 msgstr ""
 msgstr ""
 
 
-#: threads/views/generic/forum/actions.py:370
+#: threads/views/generic/forum/actions.py:372
 #, python-format
 #, python-format
 msgid "%(changed)d thread was deleted."
 msgid "%(changed)d thread was deleted."
 msgid_plural "%(changed)d threads were deleted."
 msgid_plural "%(changed)d threads were deleted."
 msgstr[0] ""
 msgstr[0] ""
 msgstr[1] ""
 msgstr[1] ""
 
 
-#: threads/views/generic/forum/actions.py:375
+#: threads/views/generic/forum/actions.py:377
 msgid "No threads were deleted."
 msgid "No threads were deleted."
 msgstr ""
 msgstr ""
 
 
@@ -3975,19 +4014,19 @@ msgstr ""
 msgid "Requested thread label does not exist."
 msgid "Requested thread label does not exist."
 msgstr ""
 msgstr ""
 
 
-#: threads/views/labelsadmin.py:34
+#: threads/views/labelsadmin.py:35
 #, python-format
 #, python-format
-msgid "New label \"%s\" has been saved."
+msgid "New label \"%(name)s\" has been saved."
 msgstr ""
 msgstr ""
 
 
-#: threads/views/labelsadmin.py:38
+#: threads/views/labelsadmin.py:39
 #, python-format
 #, python-format
-msgid "Label \"%s\" has been edited."
+msgid "Label \"%(name)s\" has been edited."
 msgstr ""
 msgstr ""
 
 
-#: threads/views/labelsadmin.py:44
+#: threads/views/labelsadmin.py:45
 #, python-format
 #, python-format
-msgid "Label \"%s\" has been deleted."
+msgid "Label \"%(name)s\" has been deleted."
 msgstr ""
 msgstr ""
 
 
 #: users/admin.py:23
 #: users/admin.py:23
@@ -5185,17 +5224,17 @@ msgstr ""
 
 
 #: users/views/admin/bans.py:49
 #: users/views/admin/bans.py:49
 #, python-format
 #, python-format
-msgid "New ban \"%s\" has been saved."
+msgid "New ban \"%(name)s\" has been saved."
 msgstr ""
 msgstr ""
 
 
 #: users/views/admin/bans.py:53
 #: users/views/admin/bans.py:53
 #, python-format
 #, python-format
-msgid "Ban \"%s\" has been edited."
+msgid "Ban \"%(name)s\" has been edited."
 msgstr ""
 msgstr ""
 
 
 #: users/views/admin/bans.py:60
 #: users/views/admin/bans.py:60
 #, python-format
 #, python-format
-msgid "Ban \"%s\" has been removed."
+msgid "Ban \"%(name)s\" has been removed."
 msgstr ""
 msgstr ""
 
 
 #: users/views/admin/ranks.py:17
 #: users/views/admin/ranks.py:17
@@ -5204,47 +5243,47 @@ msgstr ""
 
 
 #: users/views/admin/ranks.py:34
 #: users/views/admin/ranks.py:34
 #, python-format
 #, python-format
-msgid "New rank \"%s\" has been saved."
+msgid "New rank \"%(name)s\" has been saved."
 msgstr ""
 msgstr ""
 
 
 #: users/views/admin/ranks.py:38
 #: users/views/admin/ranks.py:38
 #, python-format
 #, python-format
-msgid "Rank \"%s\" has been edited."
+msgid "Rank \"%(name)s\" has been edited."
 msgstr ""
 msgstr ""
 
 
-#: users/views/admin/ranks.py:44
+#: users/views/admin/ranks.py:45
 #, python-format
 #, python-format
-msgid "Rank \"%s\" is default rank and can't be deleted."
+msgid "Rank \"%(name)s\" is default rank and can't be deleted."
 msgstr ""
 msgstr ""
 
 
-#: users/views/admin/ranks.py:48
+#: users/views/admin/ranks.py:49
 #, python-format
 #, python-format
-msgid "Rank \"%s\" is assigned to users and can't be deleted."
+msgid "Rank \"%(name)s\" is assigned to users and can't be deleted."
 msgstr ""
 msgstr ""
 
 
-#: users/views/admin/ranks.py:54
+#: users/views/admin/ranks.py:55
 #, python-format
 #, python-format
-msgid "Rank \"%s\" has been deleted."
+msgid "Rank \"%(name)s\" has been deleted."
 msgstr ""
 msgstr ""
 
 
-#: users/views/admin/ranks.py:71
+#: users/views/admin/ranks.py:72
 #, python-format
 #, python-format
-msgid "Rank \"%s\" has been moved below \"%s\"."
+msgid "Rank \"%(name)s\" has been moved below \"%(other)s\"."
 msgstr ""
 msgstr ""
 
 
-#: users/views/admin/ranks.py:89
+#: users/views/admin/ranks.py:90
 #, python-format
 #, python-format
-msgid "Rank \"%s\" has been moved above \"%s\"."
+msgid "Rank \"%(name)s\" has been moved above \"%(other)s\"."
 msgstr ""
 msgstr ""
 
 
-#: users/views/admin/ranks.py:103
+#: users/views/admin/ranks.py:104
 #, python-format
 #, python-format
-msgid "Rank \"%s\" is already default."
+msgid "Rank \"%(name)s\" is already default."
 msgstr ""
 msgstr ""
 
 
-#: users/views/admin/ranks.py:107
+#: users/views/admin/ranks.py:109
 #, python-format
 #, python-format
-msgid "Rank \"%s\" has been made default."
+msgid "Rank \"%(name)s\" has been made default."
 msgstr ""
 msgstr ""
 
 
 #: users/views/admin/users.py:43
 #: users/views/admin/users.py:43
@@ -5322,12 +5361,12 @@ msgstr ""
 
 
 #: users/views/admin/users.py:171
 #: users/views/admin/users.py:171
 #, python-format
 #, python-format
-msgid "New user \"%s\" has been registered."
+msgid "New user \"%(user)s\" has been registered."
 msgstr ""
 msgstr ""
 
 
-#: users/views/admin/users.py:201
+#: users/views/admin/users.py:202
 #, python-format
 #, python-format
-msgid "User \"%s\" has been edited."
+msgid "User \"%(user)s\" has been edited."
 msgstr ""
 msgstr ""
 
 
 #: users/views/admin/warnings.py:15
 #: users/views/admin/warnings.py:15
@@ -5336,27 +5375,27 @@ msgstr ""
 
 
 #: users/views/admin/warnings.py:23
 #: users/views/admin/warnings.py:23
 #, python-format
 #, python-format
-msgid "New warning level \"%s\" has been saved."
+msgid "New warning level \"%(name)s\" has been saved."
 msgstr ""
 msgstr ""
 
 
 #: users/views/admin/warnings.py:27
 #: users/views/admin/warnings.py:27
 #, python-format
 #, python-format
-msgid "Warning level \"%s\" has been edited."
+msgid "Warning level \"%(name)s\" has been edited."
 msgstr ""
 msgstr ""
 
 
 #: users/views/admin/warnings.py:33
 #: users/views/admin/warnings.py:33
 #, python-format
 #, python-format
-msgid "Warning level \"%s\" has been deleted."
+msgid "Warning level \"%(name)s\" has been deleted."
 msgstr ""
 msgstr ""
 
 
 #: users/views/admin/warnings.py:50
 #: users/views/admin/warnings.py:50
 #, python-format
 #, python-format
-msgid "Warning level \"%s\" has been moved below \"%s\"."
+msgid "Warning level \"%(name)s\" has been moved below \"%(other)s\"."
 msgstr ""
 msgstr ""
 
 
-#: users/views/admin/warnings.py:68
+#: users/views/admin/warnings.py:69
 #, python-format
 #, python-format
-msgid "Warning level \"%s\" has been moved above \"%s\"."
+msgid "Warning level \"%(name)s\" has been moved above \"%(other)s\"."
 msgstr ""
 msgstr ""
 
 
 #: users/views/api.py:40
 #: users/views/api.py:40

+ 2 - 2
misago/threads/tests/test_unreadthreads_view.py

@@ -12,7 +12,7 @@ class AuthenticatedTests(AuthenticatedUserTestCase):
         """empty threads list is rendered"""
         """empty threads list is rendered"""
         response = self.client.get(reverse('misago:unread_threads'))
         response = self.client.get(reverse('misago:unread_threads'))
         self.assertEqual(response.status_code, 200)
         self.assertEqual(response.status_code, 200)
-        self.assertIn("There are no threads from last", response.content)
+        self.assertIn("There are no threads with unread", response.content)
 
 
     def test_filled_threads_list(self):
     def test_filled_threads_list(self):
         """filled threads list is rendered"""
         """filled threads list is rendered"""
@@ -22,7 +22,7 @@ class AuthenticatedTests(AuthenticatedUserTestCase):
         # only unread tracker threads are shown on unread list
         # only unread tracker threads are shown on unread list
         response = self.client.get(reverse('misago:unread_threads'))
         response = self.client.get(reverse('misago:unread_threads'))
         self.assertEqual(response.status_code, 200)
         self.assertEqual(response.status_code, 200)
-        self.assertIn("There are no threads from last", response.content)
+        self.assertIn("There are no threads with unread", response.content)
 
 
         # we'll read and reply to first five threads
         # we'll read and reply to first five threads
         for thread in threads[5:]:
         for thread in threads[5:]:

+ 6 - 5
misago/threads/views/labelsadmin.py

@@ -23,7 +23,8 @@ class LabelsAdmin(generic.AdminBaseMixin):
         Label.objects.clear_cache()
         Label.objects.clear_cache()
 
 
         if self.message_submit:
         if self.message_submit:
-            messages.success(request, self.message_submit % target.name)
+            messages.success(
+                request, self.message_submit % {'name': target.name})
 
 
 
 
 class LabelsList(LabelsAdmin, generic.ListView):
 class LabelsList(LabelsAdmin, generic.ListView):
@@ -31,15 +32,15 @@ class LabelsList(LabelsAdmin, generic.ListView):
 
 
 
 
 class NewLabel(LabelsAdmin, generic.ModelFormView):
 class NewLabel(LabelsAdmin, generic.ModelFormView):
-    message_submit = _('New label "%s" has been saved.')
+    message_submit = _('New label "%(name)s" has been saved.')
 
 
 
 
 class EditLabel(LabelsAdmin, generic.ModelFormView):
 class EditLabel(LabelsAdmin, generic.ModelFormView):
-    message_submit = _('Label "%s" has been edited.')
+    message_submit = _('Label "%(name)s" has been edited.')
 
 
 
 
 class DeleteLabel(LabelsAdmin, generic.ButtonView):
 class DeleteLabel(LabelsAdmin, generic.ButtonView):
     def button_action(self, request, target):
     def button_action(self, request, target):
         target.delete()
         target.delete()
-        message = _('Label "%s" has been deleted.')
-        messages.success(request, message % unicode(target.name))
+        message = _('Label "%(name)s" has been deleted.')
+        messages.success(request, message % {'name': target.name})

+ 4 - 4
misago/users/views/admin/bans.py

@@ -46,16 +46,16 @@ class BansList(BanAdmin, generic.ListView):
 
 
 
 
 class NewBan(BanAdmin, generic.ModelFormView):
 class NewBan(BanAdmin, generic.ModelFormView):
-    message_submit = _('New ban "%s" has been saved.')
+    message_submit = _('New ban "%(name)s" has been saved.')
 
 
 
 
 class EditBan(BanAdmin, generic.ModelFormView):
 class EditBan(BanAdmin, generic.ModelFormView):
-    message_submit = _('Ban "%s" has been edited.')
+    message_submit = _('Ban "%(name)s" has been edited.')
 
 
 
 
 class DeleteBan(BanAdmin, generic.ButtonView):
 class DeleteBan(BanAdmin, generic.ButtonView):
     def button_action(self, request, target):
     def button_action(self, request, target):
         target.delete()
         target.delete()
         Ban.objects.invalidate_cache()
         Ban.objects.invalidate_cache()
-        message = _('Ban "%s" has been removed.') % unicode(target.name)
-        messages.success(request, message)
+        message = _('Ban "%(name)s" has been removed.')
+        messages.success(request, message % {'name': target.name})

+ 19 - 17
misago/users/views/admin/ranks.py

@@ -31,28 +31,29 @@ class RanksList(RankAdmin, generic.ListView):
 
 
 
 
 class NewRank(RankAdmin, generic.ModelFormView):
 class NewRank(RankAdmin, generic.ModelFormView):
-    message_submit = _('New rank "%s" has been saved.')
+    message_submit = _('New rank "%(name)s" has been saved.')
 
 
 
 
 class EditRank(RankAdmin, generic.ModelFormView):
 class EditRank(RankAdmin, generic.ModelFormView):
-    message_submit = _('Rank "%s" has been edited.')
+    message_submit = _('Rank "%(name)s" has been edited.')
 
 
 
 
 class DeleteRank(RankAdmin, generic.ButtonView):
 class DeleteRank(RankAdmin, generic.ButtonView):
     def check_permissions(self, request, target):
     def check_permissions(self, request, target):
+        message_format = {'name': target.name}
         if target.is_default:
         if target.is_default:
-            message = _('Rank "%s" is default rank and '
-                        'can\'t be deleted.')
-            return message % target.name
+            message = _('Rank "%(name)s" is default '
+                        'rank and can\'t be deleted.')
+            return message % message_format
         if target.user_set.exists():
         if target.user_set.exists():
-            message = _('Rank "%s" is assigned to users and '
-                        'can\'t be deleted.')
-            return message % target.name
+            message = _('Rank "%(name)s" is assigned to '
+                        'users and can\'t be deleted.')
+            return message % message_format
 
 
     def button_action(self, request, target):
     def button_action(self, request, target):
         target.delete()
         target.delete()
-        message = _('Rank "%s" has been deleted.') % target.name
-        messages.success(request, message)
+        message = _('Rank "%(name)s" has been deleted.')
+        messages.success(request, message % {'name': target.name})
 
 
 
 
 class MoveDownRank(RankAdmin, generic.ButtonView):
 class MoveDownRank(RankAdmin, generic.ButtonView):
@@ -68,8 +69,8 @@ class MoveDownRank(RankAdmin, generic.ButtonView):
             other_target.save(update_fields=['order'])
             other_target.save(update_fields=['order'])
             target.save(update_fields=['order'])
             target.save(update_fields=['order'])
 
 
-            message = _('Rank "%s" has been moved below "%s".')
-            targets_names = (target.name, other_target.name)
+            message = _('Rank "%(name)s" has been moved below "%(other)s".')
+            targets_names = {'name': target.name, 'other': other_target.name}
             messages.success(request, message % targets_names)
             messages.success(request, message % targets_names)
 
 
 
 
@@ -86,8 +87,8 @@ class MoveUpRank(RankAdmin, generic.ButtonView):
             other_target.save(update_fields=['order'])
             other_target.save(update_fields=['order'])
             target.save(update_fields=['order'])
             target.save(update_fields=['order'])
 
 
-            message = _('Rank "%s" has been moved above "%s".')
-            targets_names = (target.name, other_target.name)
+            message = _('Rank "%(name)s" has been moved above "%(other)s".')
+            targets_names = {'name': target.name, 'other': other_target.name}
             messages.success(request, message % targets_names)
             messages.success(request, message % targets_names)
 
 
 
 
@@ -100,9 +101,10 @@ class RankUsers(RankAdmin, generic.TargetedView):
 class DefaultRank(RankAdmin, generic.ButtonView):
 class DefaultRank(RankAdmin, generic.ButtonView):
     def check_permissions(self, request, target):
     def check_permissions(self, request, target):
         if target.is_default:
         if target.is_default:
-            return _('Rank "%s" is already default.') % target.name
+            message = _('Rank "%(name)s" is already default.')
+            return message % {'name': target.name}
 
 
     def button_action(self, request, target):
     def button_action(self, request, target):
         Rank.objects.make_rank_default(target)
         Rank.objects.make_rank_default(target)
-        message = _('Rank "%s" has been made default.')
-        messages.success(request, message % target.name)
+        message = _('Rank "%(name)s" has been made default.')
+        messages.success(request, message % {'name': target.name})

+ 6 - 4
misago/users/views/admin/users.py

@@ -168,7 +168,7 @@ class UsersList(UserAdmin, generic.ListView):
 class NewUser(UserAdmin, generic.ModelFormView):
 class NewUser(UserAdmin, generic.ModelFormView):
     Form = NewUserForm
     Form = NewUserForm
     template = 'new.html'
     template = 'new.html'
-    message_submit = _('New user "%s" has been registered.')
+    message_submit = _('New user "%(user)s" has been registered.')
 
 
     def handle_form(self, form, request, target):
     def handle_form(self, form, request, target):
         User = get_user_model()
         User = get_user_model()
@@ -190,7 +190,8 @@ class NewUser(UserAdmin, generic.ModelFormView):
         new_user.update_acl_key()
         new_user.update_acl_key()
         new_user.save()
         new_user.save()
 
 
-        messages.success(request, self.message_submit % target.username)
+        messages.success(
+            request, self.message_submit % {'user': target.username})
         return redirect('misago:admin:users:accounts:edit',
         return redirect('misago:admin:users:accounts:edit',
                         user_id=new_user.id)
                         user_id=new_user.id)
 
 
@@ -198,7 +199,7 @@ class NewUser(UserAdmin, generic.ModelFormView):
 class EditUser(UserAdmin, generic.ModelFormView):
 class EditUser(UserAdmin, generic.ModelFormView):
     Form = EditUserForm
     Form = EditUserForm
     template = 'edit.html'
     template = 'edit.html'
-    message_submit = _('User "%s" has been edited.')
+    message_submit = _('User "%(user)s" has been edited.')
 
 
     def real_dispatch(self, request, target):
     def real_dispatch(self, request, target):
         target.old_username = target.username
         target.old_username = target.username
@@ -240,4 +241,5 @@ class EditUser(UserAdmin, generic.ModelFormView):
         target.update_acl_key()
         target.update_acl_key()
         target.save()
         target.save()
 
 
-        messages.success(request, self.message_submit % target.username)
+        messages.success(
+            request, self.message_submit % {'user': target.username})

+ 10 - 8
misago/users/views/admin/warnings.py

@@ -20,18 +20,18 @@ class WarningsList(WarningsAdmin, generic.ListView):
 
 
 
 
 class NewWarning(WarningsAdmin, generic.ModelFormView):
 class NewWarning(WarningsAdmin, generic.ModelFormView):
-    message_submit = _('New warning level "%s" has been saved.')
+    message_submit = _('New warning level "%(name)s" has been saved.')
 
 
 
 
 class EditWarning(WarningsAdmin, generic.ModelFormView):
 class EditWarning(WarningsAdmin, generic.ModelFormView):
-    message_submit = _('Warning level "%s" has been edited.')
+    message_submit = _('Warning level "%(name)s" has been edited.')
 
 
 
 
 class DeleteWarning(WarningsAdmin, generic.ButtonView):
 class DeleteWarning(WarningsAdmin, generic.ButtonView):
     def button_action(self, request, target):
     def button_action(self, request, target):
         target.delete()
         target.delete()
-        message = _('Warning level "%s" has been deleted.')
-        messages.success(request, message % unicode(target.name))
+        message = _('Warning level "%(name)s" has been deleted.')
+        messages.success(request, message % {'name': target.name})
 
 
 
 
 class MoveDownWarning(WarningsAdmin, generic.ButtonView):
 class MoveDownWarning(WarningsAdmin, generic.ButtonView):
@@ -47,8 +47,9 @@ class MoveDownWarning(WarningsAdmin, generic.ButtonView):
             other_target.save(update_fields=['level'])
             other_target.save(update_fields=['level'])
             target.save(update_fields=['level'])
             target.save(update_fields=['level'])
 
 
-            message = _('Warning level "%s" has been moved below "%s".')
-            targets_names = (target.name, other_target.name)
+            message = _('Warning level "%(name)s" has '
+                        'been moved below "%(other)s".')
+            targets_names = {'name': target.name, 'other': other_target.name}
             messages.success(request, message % targets_names)
             messages.success(request, message % targets_names)
 
 
 
 
@@ -65,6 +66,7 @@ class MoveUpWarning(WarningsAdmin, generic.ButtonView):
             other_target.save(update_fields=['level'])
             other_target.save(update_fields=['level'])
             target.save(update_fields=['level'])
             target.save(update_fields=['level'])
 
 
-            message = _('Warning level "%s" has been moved above "%s".')
-            targets_names = (target.name, other_target.name)
+            message = _('Warning level "%(name)s" has '
+                        'been moved above "%(other)s".')
+            targets_names = {'name': target.name, 'other': other_target.name}
             messages.success(request, message % targets_names)
             messages.success(request, message % targets_names)