refactor: remove tr_strip_positional_args() (#2881)

* refactor: use fmt in gtk/SystemIconTray

* refactor: use fmt in gtk/MakeDialog

* refactor: remove unused tr_strip_positional_args()

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
This commit is contained in:
Charles Kerr
2022-04-07 08:23:04 -05:00
committed by GitHub
parent 8d11f0bc22
commit ffda5bb68a
8 changed files with 72 additions and 146 deletions

View File

@@ -413,7 +413,7 @@ void updateBlocklistText(Gtk::Label* w, Glib::RefPtr<Session> const& core)
{
int const n = tr_blocklistGetRuleCount(core->get_session());
auto const msg = fmt::format(
ngettext("Blocklist has {count} entry", "Blocklist has {count} entries", n),
ngettext("Blocklist has {count:L} entry", "Blocklist has {count:L} entries", n),
fmt::arg("count", n));
w->set_markup(fmt::format(FMT_STRING("<i>{:s}</i>"), msg));
}
@@ -441,7 +441,7 @@ void onBlocklistUpdated(Glib::RefPtr<Session> const& core, int n, blocklist_data
bool const success = n >= 0;
int const count = n >= 0 ? n : tr_blocklistGetRuleCount(core->get_session());
auto const msg = fmt::format(
ngettext("Blocklist has {count} entry", "Blocklist has {count} entries", count),
ngettext("Blocklist has {count:L} entry", "Blocklist has {count:L} entries", count),
fmt::arg("count", count));
data->updateBlocklistButton->set_sensitive(true);
data->updateBlocklistDialog->set_message(