Skip to content

Commit

Permalink
Merge pull request #99 from Ubiwhere/feat/translations
Browse files Browse the repository at this point in the history
added translation in portuguese
  • Loading branch information
timthelion authored May 20, 2023
2 parents 87bb13f + 65ed15a commit dde72db
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 2 deletions.
2 changes: 1 addition & 1 deletion import_export_celery/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@


class JobWithStatusMixin:
@admin.display(description=_("Job status info"))
def job_status_info(self, obj):
job_status = cache.get(self.direction + "_job_status_%s" % obj.pk)
if job_status:
Expand All @@ -18,7 +19,6 @@ def job_status_info(self, obj):


class ImportJobForm(forms.ModelForm):

model = forms.ChoiceField(label=_("Name of model to import to"))

class Meta:
Expand Down
Binary file not shown.
150 changes: 150 additions & 0 deletions import_export_celery/locale/pt/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Dan <[email protected]>, 2020.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-05-17 20:55+0000\n"
"PO-Revision-Date: 2023-05-17 21:56+0100\n"
"Last-Translator: Daniel Pluth <[email protected]>\n"
"Language-Team: \n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.3.1\n"

#: import_export_celery/admin.py:12
msgid "Job status info"
msgstr "Informação do estado do trabalho"

#: import_export_celery/admin.py:22 import_export_celery/models/importjob.py:62
msgid "Name of model to import to"
msgstr "Nome do modelo a importar"

#: import_export_celery/admin_actions.py:20
msgid "Perform import"
msgstr "Confirmar importação"

#: import_export_celery/admin_actions.py:29
msgid "Perform dry import"
msgstr "Confirmar importação"

#: import_export_celery/admin_actions.py:39
msgid "Run export job"
msgstr "Correr trabalho de exportação"

#: import_export_celery/admin_actions.py:67
msgid "Export with celery"
msgstr "Exportar com o celery"

#: import_export_celery/apps.py:7
msgid "Import Export Celery"
msgstr "Importar ou Exportar com o celery"

#: import_export_celery/models/exportjob.py:27
msgid "exported file"
msgstr "ficheiro exportado"

#: import_export_celery/models/exportjob.py:35
#: import_export_celery/models/importjob.py:30
msgid "Have we started processing the file? If so when?"
msgstr "Começou a processar o ficheiro? Se sim, quando?"

#: import_export_celery/models/exportjob.py:42
#: import_export_celery/models/importjob.py:67
msgid "Status of the job"
msgstr "Estado do trabalho"

#: import_export_celery/models/exportjob.py:48
msgid "Format of file to be exported"
msgstr "Formato do ficheiro a ser exportado"

#: import_export_celery/models/exportjob.py:55
msgid "App label of model to export from"
msgstr "Nome da aplicação do modelo para exportar de"

#: import_export_celery/models/exportjob.py:60
msgid "Name of model to export from"
msgstr "Nome do modelo a exportar de"

#: import_export_celery/models/exportjob.py:65
msgid "Resource to use when exporting"
msgstr "Recurso a utilizar aquando da exportação"

#: import_export_celery/models/exportjob.py:71
msgid "JSON list of pks to export"
msgstr "Lista de ids em formato json para exportar"

#: import_export_celery/models/exportjob.py:76
msgid "Send me an email when this export job is complete"
msgstr "Enviar um email quando o trabalho de exportação estiver completo"

#: import_export_celery/models/exportjob.py:81
msgid "Site of origin"
msgstr "Site de origem"

#: import_export_celery/models/exportjob.py:87
msgid "Export job"
msgstr "Trabalho de exportação"

#: import_export_celery/models/exportjob.py:88
msgid "Export jobs"
msgstr "Trabalhos de exportação"

#: import_export_celery/models/importjob.py:22
msgid "File to be imported"
msgstr "Arquivo a ser importado"

#: import_export_celery/models/importjob.py:37
msgid "Has the import been completed? If so when?"
msgstr "A importação foi completa? Se sim, quando?"

#: import_export_celery/models/importjob.py:44
msgid "Format of file to be imported"
msgstr "Formato do ficheiro a ser importado"

#: import_export_celery/models/importjob.py:49
msgid "Summary of changes made by this import"
msgstr "Resumo das alterações feitas por esta importação"

#: import_export_celery/models/importjob.py:56
msgid "Errors"
msgstr "Erros"

#: import_export_celery/models/importjob.py:73
msgid "Import job"
msgstr "Trabalho de importação"

#: import_export_celery/models/importjob.py:74
msgid "Import jobs"
msgstr "Trabalhos de importação"

#: import_export_celery/tasks.py:61
#, python-format
msgid "Imported file has a wrong encoding: %s"
msgstr "O arquivo importado tem uma codificação errada: %s"

#: import_export_celery/tasks.py:68
#, python-format
msgid "Error reading file: %s"
msgstr "Erro a ler o ficheiro: %s"

#: import_export_celery/tasks.py:101
#, python-format
msgid ""
"Line: %s - %s\n"
"\t%s\n"
"%s"
msgstr ""
"Linha: %s - %s\n"
"\t%s\n"
"%s"

#: import_export_celery/tasks.py:190
#, python-format
msgid "Import error %s"
msgstr "Erro de importação %s"
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.0.6 on 2023-05-15 16:34

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('import_export_celery', '0007_auto_20210210_1831'),
]

operations = [
migrations.AlterField(
model_name='exportjob',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='importjob',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
]
5 changes: 5 additions & 0 deletions import_export_celery/models/exportjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@ def __init__(self, *args, **kwargs):
)

site_of_origin = models.TextField(
verbose_name=_("Site of origin"),
max_length=255,
default="",
)

class Meta:
verbose_name = _("Export job")
verbose_name_plural = _("Export jobs")

def get_resource_class(self):
if self.resource:
return (
Expand Down
12 changes: 11 additions & 1 deletion import_export_celery/models/importjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class ImportJob(models.Model):
)

errors = models.TextField(
verbose_name=_("Errors"),
default="",
blank=True,
)
Expand All @@ -68,6 +69,10 @@ class ImportJob(models.Model):
blank=True,
)

class Meta:
verbose_name = _("Import job")
verbose_name_plural = _("Import jobs")

@staticmethod
def get_format_choices():
"""returns choices of available import formats"""
Expand All @@ -83,4 +88,9 @@ def importjob_post_save(sender, instance, **kwargs):
if not instance.processing_initiated:
instance.processing_initiated = timezone.now()
instance.save()
transaction.on_commit(lambda: run_import_job.delay(instance.pk, dry_run=getattr(settings, "IMPORT_DRY_RUN_FIRST_TIME", True)))
transaction.on_commit(
lambda: run_import_job.delay(
instance.pk,
dry_run=getattr(settings, "IMPORT_DRY_RUN_FIRST_TIME", True),
)
)

0 comments on commit dde72db

Please sign in to comment.