[gnome-builder] project-tree: simplify gettext usage



commit 92d1d38274783f37014a310a9eac7f7f57c231f9
Author: Christian Hergert <chergert redhat com>
Date:   Thu Feb 28 10:06:34 2019 -0800

    project-tree: simplify gettext usage
    
    Fixes #774

 src/plugins/project-tree/gbp-project-tree-addin.c | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)
---
diff --git a/src/plugins/project-tree/gbp-project-tree-addin.c 
b/src/plugins/project-tree/gbp-project-tree-addin.c
index 8b8ded9ec..6e2d25c62 100644
--- a/src/plugins/project-tree/gbp-project-tree-addin.c
+++ b/src/plugins/project-tree/gbp-project-tree-addin.c
@@ -713,25 +713,16 @@ gbp_project_tree_addin_transfer_cb (GObject      *object,
     }
   else
     {
+      g_autofree gchar *format = NULL;
       GPtrArray *sources;
-
-      dzl_file_transfer_stat (transfer, &stbuf);
+      gchar count[16];
 
       ide_notification_set_title (notif, _("Files copied"));
 
-      if (stbuf.n_files_total == 1)
-        {
-          ide_notification_set_body (notif, _("Copied 1 file"));
-        }
-      else
-        {
-          g_autofree gchar *format = NULL;
-          gchar count[16];
-
-          g_snprintf (count, sizeof count, "%"G_GINT64_FORMAT, stbuf.n_files_total);
-          format = g_strdup_printf (_("Copied %s files"), count);
-          ide_notification_set_body (notif, format);
-        }
+      dzl_file_transfer_stat (transfer, &stbuf);
+      g_snprintf (count, sizeof count, "%"G_GINT64_FORMAT, stbuf.n_files_total);
+      format = g_strdup_printf (ngettext ("Copied %s file", "Copied %s files", stbuf.n_files_total), count);
+      ide_notification_set_body (notif, _("Copied 1 file"));
 
       sources = g_object_get_data (G_OBJECT (task), "SOURCE_FILES");
 


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