mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-14 04:06:36 +00:00
Translate error messages
This commit is contained in:
parent
6301656a0e
commit
ebabbf475a
1 changed files with 3 additions and 2 deletions
|
@ -3,6 +3,7 @@ import csv
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from bookwyrm import models
|
from bookwyrm import models
|
||||||
from bookwyrm.models import ImportJob, ImportItem
|
from bookwyrm.models import ImportJob, ImportItem
|
||||||
|
@ -71,7 +72,7 @@ def import_data(source, job_id):
|
||||||
item.resolve()
|
item.resolve()
|
||||||
except Exception as err: # pylint: disable=broad-except
|
except Exception as err: # pylint: disable=broad-except
|
||||||
logger.exception(err)
|
logger.exception(err)
|
||||||
item.fail_reason = "Error loading book"
|
item.fail_reason = _("Error loading book")
|
||||||
item.save()
|
item.save()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -83,7 +84,7 @@ def import_data(source, job_id):
|
||||||
source, job.user, item, job.include_reviews, job.privacy
|
source, job.user, item, job.include_reviews, job.privacy
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
item.fail_reason = "Could not find a match for book"
|
item.fail_reason = _("Could not find a match for book")
|
||||||
item.save()
|
item.save()
|
||||||
finally:
|
finally:
|
||||||
job.complete = True
|
job.complete = True
|
||||||
|
|
Loading…
Reference in a new issue