Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions libdnf5-cli/output/transaction_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,14 +363,20 @@ TransactionTable::Impl::Impl(ITransaction & transaction) {
}
for (auto & replaced : tspkg->get_replaces()) {
// highlight incoming packages with epoch/version change
if (tspkg->get_package()->get_epoch() != replaced->get_epoch() ||
tspkg->get_package()->get_version() != replaced->get_version()) {
if (pkg->get_epoch() != replaced->get_epoch() || pkg->get_version() != replaced->get_version()) {
auto cl_evr = scols_line_get_cell(ln, COL_EVR);
scols_cell_set_color(cl_evr, "bold");
}

struct libscols_line * ln_replaced = scols_table_new_line(*tb, ln);
std::string name(libdnf5::utils::sformat(_("replacing {}"), replaced->get_name()));

std::string name;
if (pkg->get_name() == replaced->get_name()) {
// Abbreviated format for simple version upgrades
name = _("replacing");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to be nicer to translators, I could avoid a new translatable string (assuming "replacing" is a new translatable string) by making this:

Suggested change
name = _("replacing");
name = libdnf5::utils::sformat(_("replacing {}"), "");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Although, now that I think about it, that may not work for all translations?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For translating it's always better to have full sentences because the translators can then reorder the words as they want.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, well, the full string here is "replacing"; there's nothing else. (It's a table cell, so there are no full sentences to begin with. It previously contained "replacing <package-name>".)

} else {
name = libdnf5::utils::sformat(_("replacing {}"), replaced->get_name());
}
scols_line_set_data(ln_replaced, COL_NAME, (" " + name).c_str());
scols_line_set_data(ln_replaced, COL_ARCH, replaced->get_arch().c_str());
scols_line_set_data(ln_replaced, COL_EVR, replaced->get_evr().c_str());
Expand Down