Skip to content

Commit

Permalink
TrashContentView: Use ngettext instead of concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
ryonakano committed Mar 16, 2024
1 parent 38573c8 commit 12cd567
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Views/TrashContentView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,9 @@ public class Notejot.TrashContentView : He.Bin {
trash_status_page.action_button.visible = false;

Timeout.add_seconds (1, () => {
if (vm.trashs.get_n_items () == 1) {
trash_status_page.title = (_("Trash has") + " " +
vm.trashs.get_n_items ().to_string () + " " + _("Item"));
} else if (vm.trashs.get_n_items () >= 0) {
trash_status_page.title = (_("Trash has") + " " +
vm.trashs.get_n_items ().to_string () + " " + _("Items"));
if (vm.trashs.get_n_items () > 0) {
trash_status_page.title = ngettext("Trash has %u Item", "Trash has %u Items", vm.trashs.get_n_items ())
.printf (vm.trashs.get_n_items ());
} else {
trash_status_page.title = (_("Trash is Empty"));
}
Expand Down

0 comments on commit 12cd567

Please sign in to comment.