Add ngettext to the domain (#310)

* Update PO: add relative timestamps

* make ngettext enter the domain

This was a tricky one to solve…
This commit is contained in:
Sunniva Løvstad
2024-11-05 18:55:22 +01:00
committed by GitHub
parent 91cab62f9a
commit 8a020970fd
34 changed files with 1012 additions and 847 deletions

View File

@@ -18,7 +18,6 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
import gettext
import logging
from time import time
from typing import Any, Optional
@@ -376,12 +375,12 @@ class Importer(ErrorProducer):
)
elif self.n_games_added >= 1:
# The variable is the number of games imported
toast_title = gettext.ngettext("{} game imported", "{} games imported", self.n_games_added).format(self.n_games_added)
# The variable is the number of games.
toast_title = ngettext("{} game imported", "{} games imported", self.n_games_added).format(self.n_games_added)
if (removed_length := len(self.removed_game_ids)) >= 1:
# The variable is the number of games removed. This comes after the text "{} games imported, ".
toast_title += ", " + gettext.ngettext("{} removed", "{} removed", removed_length).format(removed_length)
# The variable is the number of games. This text comes after "{0} games imported".
toast_title += ngettext(", {} removed", ", {} removed", removed_length).format(removed_length)
if self.n_games_added or self.removed_game_ids:
toast.set_button_label(_("Undo"))