[nautilus] batch-rename : Reword "Rename %d files/folders" as "Rename %d files"



commit 735bdb195306db1936e52e9ec4150ef624b70bed
Author: Neha Yadav <inehayadav28 gmail com>
Date:   Wed Oct 12 23:18:26 2016 +0530

    batch-rename : Reword "Rename %d files/folders" as "Rename %d files"
    
    The problem is that when we select both folder and file then string
    "Rename %d files" appears which may not be the right term when
    the selected items contains both files and folders.
    
    To solve this issue we rename the string and now in place of string
    "Rename %d files" we use "Rename %d Files and Folders" for both file
    and folder.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771586

 src/nautilus-batch-rename-dialog.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-batch-rename-dialog.c b/src/nautilus-batch-rename-dialog.c
index 20f99de..4e922e7 100644
--- a/src/nautilus-batch-rename-dialog.c
+++ b/src/nautilus-batch-rename-dialog.c
@@ -2100,6 +2100,7 @@ nautilus_batch_rename_dialog_new (GList             *selection,
     GString *dialog_title;
     GList *l;
     gboolean all_targets_are_folders;
+    gboolean all_targets_are_regular_files;
 
     dialog = g_object_new (NAUTILUS_TYPE_BATCH_RENAME_DIALOG, "use-header-bar", TRUE, NULL);
 
@@ -2120,19 +2121,38 @@ nautilus_batch_rename_dialog_new (GList             *selection,
         }
     }
 
-    dialog_title = g_string_new ("");
+    all_targets_are_regular_files = TRUE;
+    for (l = selection; l != NULL; l = l->next)
+    {
+        if (!nautilus_file_is_regular_file (NAUTILUS_FILE (l->data)))
+        {
+            all_targets_are_regular_files = FALSE;
+            break;
+        }
+    }
+
+    dialog_title = g_string_new ("");   
     if (all_targets_are_folders)
     {
         g_string_append_printf (dialog_title,
                                 ngettext ("Rename %d Folder", "Rename %d Folders", g_list_length 
(selection)),
                                 g_list_length (selection));
     }
-    else
+    else if (all_targets_are_regular_files)
     {
         g_string_append_printf (dialog_title,
                                 ngettext ("Rename %d File", "Rename %d Files", g_list_length (selection)),
                                 g_list_length (selection));
     }
+    else 
+    {
+        /* To translators: %d is the total number of files and folders.
+         * Singular case of the string is never used */
+        g_string_append_printf (dialog_title,
+                                ("Rename %d Files and Folders"),
+                                g_list_length (selection));   
+    }
+
     gtk_window_set_title (GTK_WINDOW (dialog), dialog_title->str);
 
     add_tag (dialog, metadata_tags_constants[ORIGINAL_FILE_NAME]);


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