Anim: don't split keyframing error messages into singular and plural

Having different strings for singular/plural is meaningless or
insufficient in some languages, and thus complicates localization
unnecessarily.
This commit is contained in:
Nathan Vegdahl
2024-05-14 11:55:14 +02:00
committed by Nathan Vegdahl
parent d4496f5bd4
commit 6709d598cf

View File

@@ -93,104 +93,57 @@ void CombinedKeyingResult::generate_reports(ReportList *reports)
Vector<std::string> errors;
if (this->get_count(SingleKeyingResult::UNKNOWN_FAILURE) > 0) {
const int error_count = this->get_count(SingleKeyingResult::UNKNOWN_FAILURE);
if (error_count == 1) {
errors.append(RPT_("Could not insert one key for unknown reasons."));
}
else {
errors.append(
fmt::format(RPT_("Could not insert {:d} keys for unknown reasons."), error_count));
}
errors.append(
fmt::format(RPT_("Could not insert {:d} key(s) for unknown reasons."), error_count));
}
if (this->get_count(SingleKeyingResult::CANNOT_CREATE_FCURVE) > 0) {
const int error_count = this->get_count(SingleKeyingResult::CANNOT_CREATE_FCURVE);
if (error_count == 1) {
errors.append(
RPT_("Could not create one F-Curve. This can happen when only inserting to "
"available F-Curves."));
}
else {
errors.append(fmt::format(
RPT_("Could not create {:d} F-Curves. This can happen when only inserting to "
"available F-Curves."),
error_count));
}
errors.append(fmt::format(RPT_("Could not create {:d} F-Curve(s). This can happen when only "
"inserting to available F-Curves."),
error_count));
}
if (this->get_count(SingleKeyingResult::FCURVE_NOT_KEYFRAMEABLE) > 0) {
const int error_count = this->get_count(SingleKeyingResult::FCURVE_NOT_KEYFRAMEABLE);
if (error_count == 1) {
errors.append(RPT_("One F-Curve is not keyframeable. It might be locked or sampled."));
}
else {
errors.append(
fmt::format(RPT_("{:d} F-Curves are not keyframeable. They might be locked or sampled."),
error_count));
}
errors.append(
fmt::format(RPT_("{:d} F-Curve(s) are not keyframeable. They might be locked or sampled."),
error_count));
}
if (this->get_count(SingleKeyingResult::NO_KEY_NEEDED) > 0) {
const int error_count = this->get_count(SingleKeyingResult::NO_KEY_NEEDED);
if (error_count == 1) {
errors.append(
RPT_("Due to the setting 'Only Insert Needed', one keyframe has not been inserted."));
}
else {
errors.append(fmt::format(
RPT_("Due to the setting 'Only Insert Needed', {:d} keyframes have not been inserted."),
error_count));
}
errors.append(fmt::format(
RPT_("Due to the setting 'Only Insert Needed', {:d} keyframe(s) have not been inserted."),
error_count));
}
if (this->get_count(SingleKeyingResult::UNABLE_TO_INSERT_TO_NLA_STACK) > 0) {
const int error_count = this->get_count(SingleKeyingResult::UNABLE_TO_INSERT_TO_NLA_STACK);
if (error_count == 1) {
errors.append(RPT_("Due to the NLA stack setup, one keyframe has not been inserted."));
}
else {
errors.append(
fmt::format(RPT_("Due to the NLA stack setup, {:d} keyframes have not been inserted."),
error_count));
}
errors.append(
fmt::format(RPT_("Due to the NLA stack setup, {:d} keyframe(s) have not been inserted."),
error_count));
}
if (this->get_count(SingleKeyingResult::ID_NOT_EDITABLE) > 0) {
const int error_count = this->get_count(SingleKeyingResult::ID_NOT_EDITABLE);
if (error_count == 1) {
errors.append(RPT_("Inserting keys on one ID has been skipped because it is not editable."));
}
else {
errors.append(fmt::format(
RPT_("Inserting keys on {:d} IDs has been skipped because they are not editable."),
error_count));
}
errors.append(fmt::format(
RPT_("Inserting keys on {:d} ID(s) has been skipped because they are not editable."),
error_count));
}
if (this->get_count(SingleKeyingResult::ID_NOT_ANIMATABLE) > 0) {
const int error_count = this->get_count(SingleKeyingResult::ID_NOT_ANIMATABLE);
if (error_count == 1) {
errors.append(
RPT_("Inserting keys on one ID has been skipped because it cannot be animated."));
}
else {
errors.append(fmt::format(
RPT_("Inserting keys on {:d} IDs has been skipped because they cannot be animated."),
error_count));
}
errors.append(fmt::format(
RPT_("Inserting keys on {:d} ID(s) has been skipped because they cannot be animated."),
error_count));
}
if (this->get_count(SingleKeyingResult::CANNOT_RESOLVE_PATH) > 0) {
const int error_count = this->get_count(SingleKeyingResult::CANNOT_RESOLVE_PATH);
if (error_count == 1) {
errors.append(
RPT_("Inserting keys on one ID has been skipped because the RNA "
"path wasn't valid for it."));
}
else {
errors.append(fmt::format(RPT_("Inserting keys on {:d} IDs has been skipped because the RNA "
"path wasn't valid for them."),
error_count));
}
errors.append(fmt::format(RPT_("Inserting keys on {:d} ID(s) has been skipped because the RNA "
"path wasn't valid for them."),
error_count));
}
if (errors.is_empty()) {