Update to dgettext and fix translator-credits string
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
import gettext
|
||||||
import logging
|
import logging
|
||||||
from time import time
|
from time import time
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
@@ -33,7 +34,6 @@ from cartridges.importer.source import Source
|
|||||||
from cartridges.store.managers.async_manager import AsyncManager
|
from cartridges.store.managers.async_manager import AsyncManager
|
||||||
from cartridges.store.pipeline import Pipeline
|
from cartridges.store.pipeline import Pipeline
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-instance-attributes
|
# pylint: disable=too-many-instance-attributes
|
||||||
class Importer(ErrorProducer):
|
class Importer(ErrorProducer):
|
||||||
"""A class in charge of scanning sources for games"""
|
"""A class in charge of scanning sources for games"""
|
||||||
@@ -376,20 +376,13 @@ class Importer(ErrorProducer):
|
|||||||
"import",
|
"import",
|
||||||
)
|
)
|
||||||
|
|
||||||
elif self.n_games_added == 1:
|
elif self.n_games_added >= 1:
|
||||||
toast_title = _("1 game imported")
|
# The variable is the number of games imported
|
||||||
|
toast_title = gettext.ngettext("1 game imported", "{} games imported", self.n_games_added).format(self.n_games_added)
|
||||||
|
|
||||||
elif self.n_games_added > 1:
|
if (removed_length := len(self.removed_game_ids)) >= 1:
|
||||||
# The variable is the number of games
|
|
||||||
toast_title = _("{} games imported").format(self.n_games_added)
|
|
||||||
|
|
||||||
if (removed_length := len(self.removed_game_ids)) == 1:
|
|
||||||
# A single game removed
|
|
||||||
toast_title += ", " + _("1 removed")
|
|
||||||
|
|
||||||
elif removed_length > 1:
|
|
||||||
# The variable is the number of games removed
|
# The variable is the number of games removed
|
||||||
toast_title += ", " + _("{} removed").format(removed_length)
|
toast_title += ", " + gettext.ngettext("1 removed", "{} removed", removed_length).format(removed_length)
|
||||||
|
|
||||||
if self.n_games_added or self.removed_game_ids:
|
if self.n_games_added or self.removed_game_ids:
|
||||||
toast.set_button_label(_("Undo"))
|
toast.set_button_label(_("Undo"))
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ class CartridgesApplication(Adw.Application):
|
|||||||
about.set_designers(("kramo https://kramo.page",))
|
about.set_designers(("kramo https://kramo.page",))
|
||||||
about.set_copyright("© 2022-2024 kramo")
|
about.set_copyright("© 2022-2024 kramo")
|
||||||
# Translators: Replace this with your name for it to show up in the about window
|
# Translators: Replace this with your name for it to show up in the about window
|
||||||
about.set_translator_credits = (_("translator_credits"),)
|
about.set_translator_credits = (_("translator-credits"),)
|
||||||
about.set_debug_info(debug_str)
|
about.set_debug_info(debug_str)
|
||||||
about.set_debug_info_filename("cartridges.log")
|
about.set_debug_info_filename("cartridges.log")
|
||||||
about.add_legal_section(
|
about.add_legal_section(
|
||||||
|
|||||||
Reference in New Issue
Block a user