UI: use correct singular and plural nouns in report messages
authorYevgeny Makarov <jenkm>
Tue, 1 Oct 2019 18:15:16 +0000 (20:15 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 1 Oct 2019 18:18:48 +0000 (20:18 +0200)
Differential Revision: https://developer.blender.org/D5729

source/blender/blenkernel/intern/packedFile.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/object/object_add.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_view3d/view3d_ops.c

index 1085e515b3af8836baa99b93d350c6687434ca61..cc3b10b120783a11680a6226eb1d531c74b7d580 100644 (file)
@@ -267,7 +267,11 @@ void BKE_packedfile_pack_all(Main *bmain, ReportList *reports, bool verbose)
   }
 
   if (tot > 0) {
-    BKE_reportf(reports, RPT_INFO, "Packed %d files", tot);
+    BKE_reportf(reports,
+                RPT_INFO,
+                tot == 1 ? "Packed %d file" :
+                           "Packed %d files",
+                tot);
   }
   else if (verbose) {
     BKE_report(reports, RPT_INFO, "No new files have been packed");
index 51c668ed43ca284d3cf3e1bb1ea2520f201f5b3f..4636d1ee71ee4b4504bb6302f4b21a59c7373bb9 100644 (file)
@@ -2044,7 +2044,11 @@ static int edbm_edge_rotate_selected_exec(bContext *C, wmOperator *op)
   }
 
   if (tot_failed_all != 0) {
-    BKE_reportf(op->reports, RPT_WARNING, "Unable to rotate %d edge(s)", tot_failed_all);
+    BKE_reportf(op->reports,
+                RPT_WARNING,
+                tot_failed_all == 1 ? "Unable to rotate %d edge" :
+                                      "Unable to rotate %d edges",
+                tot_failed_all);
   }
 
   return OPERATOR_FINISHED;
@@ -3161,7 +3165,11 @@ static int edbm_remove_doubles_exec(bContext *C, wmOperator *op)
   }
   MEM_freeN(objects);
 
-  BKE_reportf(op->reports, RPT_INFO, "Removed %d vertices", count_multi);
+  BKE_reportf(op->reports,
+              RPT_INFO,
+              count_multi == 1 ? "Removed %d vertex" :
+                                 "Removed %d vertices",
+              count_multi);
 
   return OPERATOR_FINISHED;
 }
index 52618ba4dfc99eca99241b4b00c167d9a7e5d1dd..d6816ddbe7343f0087d6e493bd43122ec405f637 100644 (file)
@@ -1581,7 +1581,11 @@ static int object_delete_exec(bContext *C, wmOperator *op)
   }
   CTX_DATA_END;
 
-  BKE_reportf(op->reports, RPT_INFO, "Deleted %u object(s)", changed_count);
+  BKE_reportf(op->reports,
+              RPT_INFO,
+              changed_count == 1 ? "Deleted %u object" :
+                                   "Deleted %u objects",
+              changed_count);
 
   if (changed_count == 0) {
     return OPERATOR_CANCELLED;
index 19402316882e67c0f9db8dba65bf0d6674aa4acf..2ea0e9dc018380056625d88639c2229e4a74b10a 100644 (file)
@@ -3076,7 +3076,11 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
     return OPERATOR_CANCELLED;
   }
 
-  BKE_reportf(op->reports, RPT_INFO, "Removed %d double particles", totremoved);
+  BKE_reportf(op->reports,
+              RPT_INFO,
+              totremoved == 1 ? "Removed %d double particle" :
+                                "Removed %d double particles",
+              totremoved);
 
   DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
   WM_event_add_notifier(C, NC_OBJECT | ND_PARTICLE | NA_EDITED, ob);
index a8dfad852323ec1e66cf4c7da80d967283064bb2..39f7bf001f3265968e66f3c610373b3ee04c1e78 100644 (file)
@@ -2298,7 +2298,12 @@ static int image_save_sequence_exec(bContext *C, wmOperator *op)
 
   /* get a filename for menu */
   BLI_split_dir_part(first_ibuf->name, di, sizeof(di));
-  BKE_reportf(op->reports, RPT_INFO, "%d image(s) will be saved in %s", tot, di);
+  BKE_reportf(op->reports,
+              RPT_INFO,
+              tot == 1 ? "%d image will be saved in %s" :
+                         "%d images will be saved in %s",
+              tot,
+              di);
 
   iter = IMB_moviecacheIter_new(image->cache);
   while (!IMB_moviecacheIter_done(iter)) {
index 0e2a8afea17bee152a36c61c27d3f5955268fb37..c81d292a8593b8fb8e0314cff3da48833b78cc0a 100644 (file)
@@ -770,7 +770,11 @@ static int outliner_id_copy_exec(bContext *C, wmOperator *op)
   BLI_make_file_string("/", str, BKE_tempdir_base(), "copybuffer.blend");
   BKE_copybuffer_save(bmain, str, op->reports);
 
-  BKE_reportf(op->reports, RPT_INFO, "Copied %d selected data-blocks", num_ids);
+  BKE_reportf(op->reports,
+              RPT_INFO,
+              num_ids == 1 ? "Copied %d selected data-block" :
+                             "Copied %d selected data-blocks",
+              num_ids);
 
   return OPERATOR_FINISHED;
 }
@@ -804,7 +808,11 @@ static int outliner_id_paste_exec(bContext *C, wmOperator *op)
 
   WM_event_add_notifier(C, NC_WINDOW, NULL);
 
-  BKE_reportf(op->reports, RPT_INFO, "%d data-blocks pasted", num_pasted);
+  BKE_reportf(op->reports,
+              RPT_INFO,
+              num_pasted == 1 ? "%d data-block pasted" :
+                                "%d data-blocks pasted",
+              num_pasted);
   return OPERATOR_FINISHED;
 }
 
@@ -2257,7 +2265,11 @@ static int outliner_orphans_purge_exec(bContext *C, wmOperator *op)
 
   BKE_id_multi_tagged_delete(bmain);
 
-  BKE_reportf(op->reports, RPT_INFO, "Deleted %d data-blocks", num_tagged[INDEX_ID_NULL]);
+  BKE_reportf(op->reports,
+              RPT_INFO,
+              num_tagged[INDEX_ID_NULL] == 1 ? "Deleted %d data-block" :
+                                               "Deleted %d data-blocks",
+              num_tagged[INDEX_ID_NULL]);
 
   /* XXX: tree management normally happens from draw_outliner(), but when
    *      you're clicking to fast on Delete object from context menu in
index e5a145b041119e116f1c5a94dd1d2010824eb6a6..37eea6b03d79adf058006690e27b49896d6ff3f6 100644 (file)
@@ -79,7 +79,11 @@ static int view3d_copybuffer_exec(bContext *C, wmOperator *op)
   BLI_make_file_string("/", str, BKE_tempdir_base(), "copybuffer.blend");
   BKE_copybuffer_save(bmain, str, op->reports);
 
-  BKE_reportf(op->reports, RPT_INFO, "Copied %d selected objects", num_copied);
+  BKE_reportf(op->reports,
+              RPT_INFO,
+              num_copied == 1 ? "Copied %d selected object" :
+                                "Copied %d selected objects",
+              num_copied);
 
   return OPERATOR_FINISHED;
 }
@@ -118,7 +122,11 @@ static int view3d_pastebuffer_exec(bContext *C, wmOperator *op)
 
   WM_event_add_notifier(C, NC_WINDOW, NULL);
 
-  BKE_reportf(op->reports, RPT_INFO, "%d objects pasted", num_pasted);
+  BKE_reportf(op->reports,
+              RPT_INFO,
+              num_pasted == 1 ? "%d object pasted" :
+                                "%d objects pasted",
+              num_pasted);
 
   return OPERATOR_FINISHED;
 }