UI: use correct singular and plural nouns in report messages

Differential Revision: https://developer.blender.org/D5729
This commit is contained in:
Yevgeny Makarov
2019-10-01 20:15:16 +02:00
committed by Brecht Van Lommel
parent 17f6b4d0f8
commit 3e8276311e
7 changed files with 56 additions and 11 deletions

View 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");

View 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;
}

View 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;

View 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);

View 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)) {

View 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

View 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;
}