GNOME Bugzilla – Bug 771586
batch rename: Reword "Rename %d files/folders" as "Rename %d items"
Last modified: 2016-11-22 11:30:57 UTC
The string "Rename %d files" may not be the right term when the selected items contains both files and folders. It might be better to use "Rename %d items" which can be used both for Files and Folders.
Items is not very understandable. We use "files and folders". But yeah good idea, we need to do this all over Nautilus.
Can anyone help me with this bug. I build nautilus.
(In reply to Neha yadav from comment #2) > Can anyone help me with this bug. I build nautilus. look at batch-rename-dialog.c and try to search for those strings mentioned in the comment above "Rename %d files"
(In reply to Carlos Soriano from comment #3) > look at batch-rename-dialog.c and try to search for those strings mentioned > in the comment above "Rename %d files" I found it "Rename %d files". Now my question is shall I only remove "Rename %d files" and use "Rename %d items" or anything else needed.
(In reply to Neha yadav from comment #4) > (In reply to Carlos Soriano from comment #3) > > look at batch-rename-dialog.c and try to search for those strings mentioned > > in the comment above "Rename %d files" > > I found it "Rename %d files". > Now my question is shall I only remove "Rename %d files" and use "Rename %d > items" or anything else needed. We need to make a differentiation between when all of them are files "Rename %d files", when all of them are folders "Rename %d folders" and when there is a mix between files and folders "Rename %d folders and files". For do this difference in several places, for example, in batch-rename-dialog or nautilus-file. You can search for "folders". I'm attaching here a patch to rework the nautilus-file.c example, since currently it's using items. You can follow a similar pattern for batch-rename.
Created attachment 336483 [details] [review] file: reword "items" to "files and folders" It looks more explicit and clear than using items.
(In reply to Carlos Soriano from comment #6) > Created attachment 336483 [details] [review] [review] > file: reword "items" to "files and folders" > > It looks more explicit and clear than using items. "%'u files and folders" (instead of simply items) may be a long string which could break the design in some locales.
(In reply to Mohammed Sadiq from comment #7) > (In reply to Carlos Soriano from comment #6) > > Created attachment 336483 [details] [review] [review] [review] > > file: reword "items" to "files and folders" > > > > It looks more explicit and clear than using items. > > "%'u files and folders" (instead of simply items) may be a long string which > could break the design in some locales. The widgets will supposedly grow, if not, it's a bug.
Review of attachment 336483 [details] [review]: my own patch review
Created attachment 337523 [details] [review] batch-rename: Reword "Rename %d files/folders" as "Rename %d items" 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 sting "Rename %d files" we use "Rename %d Files and Folders" for both file and folder.
Review of attachment 337523 [details] [review]: Hey Neha, good progress on this! You are pretty close. ::: src/nautilus-batch-rename-dialog.c @@ +2132,3 @@ GList *l; gboolean all_targets_are_folders; + gboolean all_targets_are_files; I know this is slightly confusing, but all folders and files are "files". You need to differenciate "regular files" so this boolean should be called all_targets_are_regular_files instead. @@ +2146,3 @@ for (l = selection; l != NULL; l = l->next) { + if (nautilus_file_is_regular_file (NAUTILUS_FILE (l->data))) you actually want to know whether some of the files doesn't go with the logic you want. This is exactly !nautilus_file_is_directory, rather than checking if it's a regular file. @@ +2156,3 @@ + for (l = selection; l != NULL; l = l->next) + { + if (nautilus_file_is_directory (NAUTILUS_FILE (l->data))) here's is similar to previously, but the other way around. You want to check if all files are regular files. This is not done by checking whether they are something else, but rather whether they are not regular files.
Created attachment 338443 [details] [review] batch-rename: Reword "Rename %d files/folders" as "Rename %d items" 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.
Review of attachment 338443 [details] [review]: Good work on it! Now looks good, congrats to your contribution! :) (there is a small nitpick in the commit message, the title needs update since it says: batch-rename: Reword "Rename %d files/folders" as "Rename %d items" which is no longer the case)
Created attachment 338586 [details] [review] 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.
Review of attachment 338586 [details] [review]: I really would prefer “items”, but it is not up to me. :| ::: src/nautilus-batch-rename-dialog.c @@ +2194,3 @@ + { + g_string_append_printf (dialog_title, + ngettext ("Rename %d File and Folder", "Rename %d Files and Folders", g_list_length (selection)), This is a bit funky. The singular version will never be used, so maybe it needs a comment if we are going with this, so translators would not have to bother?
Created attachment 339014 [details] [review] 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.
(In reply to Ernestas Kulik from comment #15) > Review of attachment 338586 [details] [review] [review]: > > I really would prefer “items”, but it is not up to me. :| Think about "items" in other languages. For example in Spanish would be the literal translations of "objects" which is less than understandable. Let's be a little explicit here to make sure users understand it.
Review of attachment 339014 [details] [review]: Looks excellent now, thanks Neha!
(In reply to Ernestas Kulik from comment #15) > Review of attachment 338586 [details] [review] [review]: > > I really would prefer “items”, but it is not up to me. :| > > ::: src/nautilus-batch-rename-dialog.c > @@ +2194,3 @@ > + { > + g_string_append_printf (dialog_title, > + ngettext ("Rename %d File and Folder", > "Rename %d Files and Folders", g_list_length (selection)), > > This is a bit funky. The singular version will never be used, so maybe it > needs a comment if we are going with this, so translators would not have to > bother? That's true... sorry I just noticed your comment. Neha, could you add a comment for translators? Search on the source code for "Translators" to know how and where to add a comment for them.
Review of attachment 339014 [details] [review]: Changing patch status based on Ernestas review
Created attachment 339041 [details] [review] 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.
Comment on attachment 339014 [details] [review] batch-rename: Reword "Rename %d files/folders" as "Rename %d files" >From 50c4e0a12e1ca7eea12b73eb179451c45c1c21c9 Mon Sep 17 00:00:00 2001 >From: Neha Yadav <inehayadav28@gmail.com> >Date: Wed, 12 Oct 2016 23:18:26 +0530 >Subject: [PATCH] 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 | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > >diff --git a/src/nautilus-batch-rename-dialog.c b/src/nautilus-batch-rename-dialog.c >index 20f99de..1fd7607 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,36 @@ 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 >+ { >+ g_string_append_printf (dialog_title, >+ ngettext ("Rename %d File and Folder", "Rename %d Files and Folders", g_list_length (selection)), >+ g_list_length (selection)); >+ } >+ > gtk_window_set_title (GTK_WINDOW (dialog), dialog_title->str); > > add_tag (dialog, metadata_tags_constants[ORIGINAL_FILE_NAME]); >-- >2.7.4
Review of attachment 339041 [details] [review]: Looks good now to me! Thanks Neha!
Thanks Neha for the patch! Attachment 336483 [details] pushed as a8dbefc - file: reword "items" to "files and folders" Attachment 339041 [details] pushed as 735bdb1 - batch-rename : Reword "Rename %d files/folders" as "Rename %d files"
"Rename %d Files and Folders" in src/nautilus-batch-rename-dialog.c is not marked for translation.
Created attachment 339476 [details] [review] batch-rename-dialog: mark string for translation
I'm not sure how this went through Ernestas and my eyes unnoticed :( sorry for that! Attachment 339476 [details] pushed as 21bcdf7 - batch-rename-dialog: mark string for translation
(In reply to Carlos Soriano from comment #24) > Thanks Neha for the patch! > > Attachment 336483 [details] pushed as a8dbefc - file: reword "items" to > "files and folders" > Attachment 339041 [details] pushed as 735bdb1 - batch-rename : Reword > "Rename %d files/folders" as "Rename %d files" Carlos, a8dbefc is broken with a single directory child. Both includes_directories and includes_files are true regardless of the count, it appears.
(In reply to Ernestas Kulik from comment #28) > (In reply to Carlos Soriano from comment #24) > > Thanks Neha for the patch! > > > > Attachment 336483 [details] pushed as a8dbefc - file: reword "items" to > > "files and folders" > > Attachment 339041 [details] pushed as 735bdb1 - batch-rename : Reword > > "Rename %d files/folders" as "Rename %d files" > > Carlos, a8dbefc is broken with a single directory child. Both > includes_directories and includes_files are true regardless of the count, it > appears. reverted https://git.gnome.org/browse/nautilus/commit/?id=f879c81b4e6af0cfb13329c33e7fd1717db92b79