Merge lp:~azzar1/update-manager/fix-1714489 into lp:update-manager

Proposed by Andrea Azzarone on 2017-09-04
Status: Merged
Merged at revision: 2789
Proposed branch: lp:~azzar1/update-manager/fix-1714489
Merge into: lp:update-manager
Diff against target: 29 lines (+6/-6)
1 file modified
UpdateManager/Dialogs.py (+6/-6)
To merge this branch: bzr merge lp:~azzar1/update-manager/fix-1714489
Reviewer Review Type Date Requested Status
Sebastien Bacher 2017-09-04 Approve on 2017-09-04
Review via email: mp+330150@code.launchpad.net

Commit Message

Adjust the use of ngettext to fix lp bug 1714489.

To post a comment you must log in.
Sebastien Bacher (seb128) wrote :

that makes sense

review: Approve
2790. By Andrea <andrea@andrea-XPS-15-9550> on 2017-09-04

Move the python string formatter outside the ngettext function.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UpdateManager/Dialogs.py'
2--- UpdateManager/Dialogs.py 2017-08-31 07:59:38 +0000
3+++ UpdateManager/Dialogs.py 2017-09-04 10:29:41 +0000
4@@ -160,19 +160,19 @@
5 needs_reschedule = True
6 elif ps == "applied":
7 fixes = [fix for fix in fixes if fix.patched]
8- d = ngettext("1 Livepatch update applied since the last "
9+ d = ngettext("%d Livepatch update applied since the last "
10 "restart.",
11 "%d Livepatch updates applied since the last "
12- "restart." % len(fixes),
13- len(fixes))
14+ "restart.",
15+ len(fixes)) % len(fixes)
16 self.set_desc(d)
17 elif ps == "applied-with-bug" or ps == "apply-failed":
18 fixes = [fix for fix in fixes if fix.patched]
19- d = ngettext("1 Livepatch update failed to apply since the "
20+ d = ngettext("%d Livepatch update failed to apply since the "
21 "last restart.",
22 "%d Livepatch updates failed to apply since the "
23- "last restart." % len(fixes),
24- len(fixes))
25+ "last restart.",
26+ len(fixes)) % len(fixes)
27 self.set_desc(d)
28 elif ps == "nothing-to-apply":
29 pass

Subscribers

People subscribed via source and target branches

to status/vote changes: