Merge lp:~keegan-csmith/ibid/memoplurality-634257-0.1 into lp:~ibid-core/ibid/old-release-0.1-1.6

Proposed by Keegan Carruthers-Smith
Status: Merged
Approved by: Stefano Rivera
Approved revision: 971
Merged at revision: 973
Proposed branch: lp:~keegan-csmith/ibid/memoplurality-634257-0.1
Merge into: lp:~ibid-core/ibid/old-release-0.1-1.6
Diff against target: 43 lines (+10/-5)
2 files modified
ibid/plugins/memo.py (+9/-4)
ibid/utils/__init__.py (+1/-1)
To merge this branch: bzr merge lp:~keegan-csmith/ibid/memoplurality-634257-0.1
Reviewer Review Type Date Requested Status
Stefano Rivera Approve
marcog (community) Approve
Max Rabkin Approve
Review via email: mp+47108@code.launchpad.net

Commit message

Use correct plurality in pending memos message

To post a comment you must log in.
Revision history for this message
Max Rabkin (max-rabkin) :
review: Approve
Revision history for this message
marcog (marco-gallotta) :
review: Approve
Revision history for this message
Stefano Rivera (stefanor) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/memo.py'
2--- ibid/plugins/memo.py 2011-01-12 14:16:31 +0000
3+++ ibid/plugins/memo.py 2011-01-21 21:16:11 +0000
4@@ -15,7 +15,7 @@
5 from ibid.db.models import Identity, Account
6 from ibid.auth import permission
7 from ibid.plugins.identity import get_identities
8-from ibid.utils import ago, format_date
9+from ibid.utils import ago, format_date, plural
10
11 features = {'memo': {
12 'description': u'Keeps messages for people.',
13@@ -324,9 +324,14 @@
14 u' so ask me in private.',
15 len(memos), target=event.sender['connection'])
16 elif len(memos) > 0:
17- event.addresponse(u'You have %s messages. '
18- u"Would you like to read them now?",
19- len(memos),
20+ event.addresponse(
21+ plural(
22+ len(memos),
23+ u'You have %(memo_count)d message. '
24+ u'Would you like to read it now?',
25+ u'You have %(memo_count)d messages. '
26+ u'Would you like to read them now?'),
27+ { 'memo_count' : len(memos) },
28 target=event.sender['connection'])
29 else:
30 nomemos_cache.add(event.identity)
31
32=== modified file 'ibid/utils/__init__.py'
33--- ibid/utils/__init__.py 2011-01-12 14:16:31 +0000
34+++ ibid/utils/__init__.py 2011-01-21 21:16:11 +0000
35@@ -262,7 +262,7 @@
36 .join(filter(None, [separator.join(items[:-1])] + items[-1:])))
37
38 def plural(count, singular, plural):
39- "Return sigular or plural depending on count"
40+ "Return singular or plural depending on count"
41 if count == 1:
42 return singular
43 return plural

Subscribers

People subscribed via source and target branches