diff --git a/src/errors/friendly_error.py b/src/errors/friendly_error.py index 9fef536..4c9ca7f 100644 --- a/src/errors/friendly_error.py +++ b/src/errors/friendly_error.py @@ -16,12 +16,12 @@ class FriendlyError(Exception): @property def title(self) -> str: """Get the gettext translated error title""" - return _(self.title_format).format(self.title_args) + return self.title_format.format(self.title_args) @property def subtitle(self) -> str: """Get the gettext translated error subtitle""" - return _(self.subtitle_format).format(self.subtitle_args) + return self.subtitle_format.format(self.subtitle_args) def __init__( self, diff --git a/src/importer/sources/source.py b/src/importer/sources/source.py index 80c62a1..89475a4 100644 --- a/src/importer/sources/source.py +++ b/src/importer/sources/source.py @@ -101,7 +101,13 @@ class Source(Iterable): def __iter__(self) -> SourceIterator: """Get an iterator for the source""" - for location_name in ("data", "cache", "config"): + for location_name in ( + locations := { + "data": _("data"), + "cache": _("cache"), + "config": _("configuration"), + }.keys() + ): location = getattr(self, f"{location_name}_location", None) if location is None: continue @@ -109,9 +115,9 @@ class Source(Iterable): location.resolve() except UnresolvableLocationError as error: raise FriendlyError( - # The variable is the source's name - f"Invalid {location_name} location for {{}}", - "Change it or disable the source in the preferences", + # The variables are the type of location (eg. cache) and the source's name + _("Invalid {} location for {{}}").format(locations[location_name]), + _("Change it or disable the source in the preferences"), (self.name,), (self.name,), ) from error diff --git a/src/store/managers/sgdb_manager.py b/src/store/managers/sgdb_manager.py index b535381..64a6d83 100644 --- a/src/store/managers/sgdb_manager.py +++ b/src/store/managers/sgdb_manager.py @@ -44,6 +44,6 @@ class SGDBManager(AsyncManager): # If invalid auth, cancel all SGDBManager tasks self.cancellable.cancel() raise FriendlyError( - "Couldn't authenticate SteamGridDB", - "Verify your API key in preferences", + _("Couldn't authenticate SteamGridDB"), + _("Verify your API key in preferences"), ) from error