From: hernani Date: Fri, 7 May 2010 12:14:27 +0000 (+0000) Subject: Fixed http://jira.osqa.net/browse/OSQA-216. X-Git-Tag: live~970 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/b8dacc53495e1c3a4a2e16a800168a9908725936 Fixed http://jira.osqa.net/browse/OSQA-216. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@159 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/actions/user.py b/forum/actions/user.py index 2695f9f..b281f14 100644 --- a/forum/actions/user.py +++ b/forum/actions/user.py @@ -47,7 +47,8 @@ class AwardAction(ActionProxy): return None def describe(self, viewer=None): - return _("%(user)s was awarded the %(badge_name)s badge") % { + return _("%(user)s %(were_was)s awarded the %(badge_name)s badge") % { 'user': self.hyperlink(self.user.get_profile_url(), self.friendly_username(viewer, self.user)), + 'were_was': self.viewer_or_user_verb(viewer, self.user, _('were'), _('was')), 'badge_name': self.award.all()[0].badge.name, } \ No newline at end of file diff --git a/forum/models/action.py b/forum/models/action.py index 10eb165..583b27c 100644 --- a/forum/models/action.py +++ b/forum/models/action.py @@ -187,6 +187,9 @@ class ActionProxy(Action): def friendly_ownername(self, owner, user): return (owner == user) and _('your') or user.username + def viewer_or_user_verb(self, viewer, user, viewer_verb, user_verb): + return (viewer == user) and viewer_verb or user_verb + def hyperlink(self, url, title, **attrs): return '%s' % (url, " ".join('%s="%s"' % i for i in attrs.items()), title)