Merge lp:~artmello/gallery-app/gallery-app-fix_1551149 into lp:gallery-app

Proposed by Arthur Mello
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 1303
Merged at revision: 1309
Proposed branch: lp:~artmello/gallery-app/gallery-app-fix_1551149
Merge into: lp:gallery-app
Diff against target: 97 lines (+34/-40)
2 files modified
rc/qml/EventsOverview.qml (+17/-20)
rc/qml/PhotosOverview.qml (+17/-20)
To merge this branch: bzr merge lp:~artmello/gallery-app/gallery-app-fix_1551149
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+291809@code.launchpad.net

Commit message

Add proper ngettext-style plural forms

Description of the change

Add proper ngettext-style plural forms

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

code looks great.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rc/qml/EventsOverview.qml'
2--- rc/qml/EventsOverview.qml 2016-02-12 11:14:22 +0000
3+++ rc/qml/EventsOverview.qml 2016-04-13 19:04:28 +0000
4@@ -71,27 +71,24 @@
5 id: deleteDialog
6 DeleteDialog {
7 title: {
8- if (organicEventView.selection.selectedMediaCount === 1) {
9- if (organicEventView.selection.selectedVideosCount === 0)
10- return i18n.tr("Delete 1 photo");
11- else
12- return i18n.tr("Delete 1 video");
13+ if (organicEventView.selection.selectedVideosCount === 0) {
14+ //No videos
15+ return i18n.tr("Delete %1 photo",
16+ "Delete %1 photos",
17+ organicEventView.selection.selectedPhotosCount)
18+ .arg(organicEventView.selection.selectedPhotosCount);
19+ } else if (organicEventView.selection.selectedPhotosCount === 0) {
20+ //No photos
21+ return i18n.tr("Delete %1 video",
22+ "Delete %1 videos",
23+ organicEventView.selection.selectedVideosCount)
24+ .arg(organicEventView.selection.selectedVideosCount);
25 } else {
26- if (organicEventView.selection.selectedVideosCount === 0)
27- return i18n.tr("Delete %1 photos").arg(organicEventView.selection.selectedPhotosCount);
28- else if (organicEventView.selection.selectedPhotosCount === 0)
29- return i18n.tr("Delete %1 videos").arg(organicEventView.selection.selectedVideosCount);
30- else {
31- if (organicEventView.selection.selectedVideosCount === 1 && organicEventView.selection.selectedPhotosCount !== 1)
32- return i18n.tr("Delete %1 photos and 1 video").arg(organicEventView.selection.selectedPhotosCount);
33- else if (organicEventView.selection.selectedPhotosCount === 1 && organicEventView.selection.selectedVideosCount !== 1)
34- return i18n.tr("Delete 1 photo and %1 videos").arg(organicEventView.selection.selectedVideosCount);
35- else if (organicEventView.selection.selectedVideosCount === 1 && organicEventView.selection.selectedPhotosCount === 1)
36- return i18n.tr("Delete 1 photo and 1 video");
37- else
38- return i18n.tr("Delete %1 photos and %2 videos").arg(organicEventView.selection.selectedPhotosCount)
39- .arg(organicEventView.selection.selectedVideosCount);
40- }
41+ //Mix of photos and videos
42+ return i18n.tr("Delete %1 media file",
43+ "Delete %1 media files",
44+ organicEventView.selection.selectedMediaCount)
45+ .arg(organicEventView.selection.selectedMediaCount);
46 }
47 }
48
49
50=== modified file 'rc/qml/PhotosOverview.qml'
51--- rc/qml/PhotosOverview.qml 2016-02-12 11:14:22 +0000
52+++ rc/qml/PhotosOverview.qml 2016-04-13 19:04:28 +0000
53@@ -80,27 +80,24 @@
54 id: deleteDialog
55 DeleteDialog {
56 title: {
57- if (d.selection.selectedMediaCount === 1) {
58- if (d.selection.selectedVideosCount === 0)
59- return i18n.tr("Delete 1 photo");
60- else
61- return i18n.tr("Delete 1 video");
62+ if (d.selection.selectedVideosCount === 0) {
63+ //No videos
64+ return i18n.tr("Delete %1 photo",
65+ "Delete %1 photos",
66+ d.selection.selectedPhotosCount)
67+ .arg(d.selection.selectedPhotosCount);
68+ } else if (d.selection.selectedPhotosCount === 0) {
69+ //No photos
70+ return i18n.tr("Delete %1 video",
71+ "Delete %1 videos",
72+ d.selection.selectedVideosCount)
73+ .arg(d.selection.selectedVideosCount);
74 } else {
75- if (d.selection.selectedVideosCount === 0)
76- return i18n.tr("Delete %1 photos").arg(d.selection.selectedPhotosCount);
77- else if (d.selection.selectedPhotosCount === 0)
78- return i18n.tr("Delete %1 videos").arg(d.selection.selectedVideosCount);
79- else {
80- if (d.selection.selectedVideosCount === 1 && d.selection.selectedPhotosCount !== 1)
81- return i18n.tr("Delete %1 photos and 1 video").arg(d.selection.selectedPhotosCount);
82- else if (d.selection.selectedPhotosCount === 1 && d.selection.selectedVideosCount !== 1)
83- return i18n.tr("Delete 1 photo and %1 videos").arg(d.selection.selectedVideosCount);
84- else if (d.selection.selectedVideosCount === 1 && d.selection.selectedPhotosCount === 1)
85- return i18n.tr("Delete 1 photo and 1 video");
86- else
87- return i18n.tr("Delete %1 photos and %2 videos").arg(d.selection.selectedPhotosCount)
88- .arg(d.selection.selectedVideosCount);
89- }
90+ //Mix of photos and videos
91+ return i18n.tr("Delete %1 media file",
92+ "Delete %1 media files",
93+ d.selection.selectedMediaCount)
94+ .arg(d.selection.selectedMediaCount);
95 }
96 }
97 onDeleteClicked: {

Subscribers

People subscribed via source and target branches