Skip to content

Commit

Permalink
i18n: Unwind "No {} to remove for argument: {}"
Browse files Browse the repository at this point in the history
In some languages a correct translation of that message depends on the
first argument ("No {}"). This patch removes that argument by spelling
all four possible values in full text.

Fixes: #1471
  • Loading branch information
ppisar authored and m-blaha committed May 13, 2024
1 parent bd820c4 commit 1e94648
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions libdnf5/base/log_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,17 @@ std::string LogEvent::to_string(
// TODO(jmracek) Improve messages => Each message can contain also an action
case GoalProblem::NOT_FOUND:
if (action == GoalAction::REMOVE) {
std::string spec_type_str;
switch (*spec_type) {
case libdnf5::transaction::TransactionItemType::PACKAGE:
spec_type_str = _("packages");
break;
return ret.append(utils::sformat(_("No packages to remove for argument: {}"), *spec));
case libdnf5::transaction::TransactionItemType::GROUP:
spec_type_str = _("groups");
break;
return ret.append(utils::sformat(_("No groups to remove for argument: {}"), *spec));
case libdnf5::transaction::TransactionItemType::ENVIRONMENT:
spec_type_str = _("environmental groups");
break;
return ret.append(
utils::sformat(_("No environmental groups to remove for argument: {}"), *spec));
case libdnf5::transaction::TransactionItemType::MODULE:
spec_type_str = _("modules");
break;
return ret.append(utils::sformat(_("No modules to remove for argument: {}"), *spec));
}
return ret.append(utils::sformat(_("No {} to remove for argument: {}"), spec_type_str, *spec));
} else if (action == GoalAction::INSTALL_BY_COMPS) {
if (spec_type && *spec_type == libdnf5::transaction::TransactionItemType::GROUP) {
return ret.append(utils::sformat(_("No match for group from environment: {}"), *spec));
Expand Down

0 comments on commit 1e94648

Please sign in to comment.