[gnome-documents/gnome-3-16] notifications: Improve the delete message



commit d4269d756c0ed8644aa23176816407901ad261f0
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Mar 5 10:33:01 2015 +0100

    notifications: Improve the delete message
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745658

 src/notifications.js |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/src/notifications.js b/src/notifications.js
index b32c77d..2f261c2 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -47,9 +47,19 @@ const DeleteNotification = new Lang.Class({
                                      margin_start: 12,
                                      margin_end: 12 });
 
-        let msg = Gettext.ngettext("Selected item has been deleted",
-                                   "Selected items have been deleted",
-                                   this._docs.length);
+        let msg;
+
+        if (this._docs.length == 1 && this._docs[0].name) {
+            // Translators: only one item has been deleted and %s is its name
+            msg = (_("ā€œ%sā€ deleted")).format(this._docs[0].name);
+        } else {
+            // Translators: one or more items might have been deleted, and %d
+            // is the count
+            msg = Gettext.ngettext("%d item deleted",
+                                   "%d items deleted",
+                                   this._docs.length).format(this._docs.length);
+        }
+
         let label = new Gtk.Label({ label: msg,
                                     halign: Gtk.Align.START });
         this.widget.add(label);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]