Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad translation string format #1622

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Changelog
- Removed reference to tablib dev from tox build (#1603)
- Add customizable blocks in import.html (#1598)
- Updated ru translation (#1604)
- Fixed badly formatted translation string (#1622)

3.2.0 (2023-04-12)
------------------
Expand Down
14 changes: 6 additions & 8 deletions import_export/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,12 @@ def write_to_tmp_storage(self, import_file, input_format):
return tmp_storage

def add_data_read_fail_error_to_form(self, form, e):
form.add_error(
"import_file",
_(
f"'{type(e).__name__}' encountered while trying to read file. "
"Ensure you have chosen the correct format for the file. "
f"{str(e)}"
),
)
exc_name = repr(type(e).__name__)
msg = _(
"%(exc_name)s encountered while trying to read file. "
"Ensure you have chosen the correct format for the file."
) % {"exc_name": exc_name}
form.add_error("import_file", msg)

def import_action(self, request, *args, **kwargs):
"""
Expand Down
53 changes: 27 additions & 26 deletions import_export/locale/ar/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-04-12 18:40+0100\n"
"POT-Creation-Date: 2023-09-12 15:15+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -19,36 +19,37 @@ msgstr ""
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#: admin.py:214
#: admin.py:241
#, python-format
msgid "%s through import_export"
msgstr ""

#: admin.py:220
#: admin.py:248
msgid "Import finished, with {} new and {} updated {}."
msgstr ""

#: admin.py:456
#: admin.py:496
#, python-format
msgid ""
"'{type(e).__name__}' encountered while trying to read file. Ensure you have "
"chosen the correct format for the file. "
"%(exc_name)s encountered while trying to read file. Ensure you have chosen "
"the correct format for the file."
msgstr ""

#: admin.py:580 templates/admin/import_export/change_list_import_item.html:5
#: admin.py:650 templates/admin/import_export/change_list_import_item.html:5
#: templates/admin/import_export/import.html:19
msgid "Import"
msgstr "إستبراد"

#: admin.py:752 templates/admin/import_export/change_list_export_item.html:5
#: admin.py:836 templates/admin/import_export/change_list_export_item.html:5
#: templates/admin/import_export/export.html:12
msgid "Export"
msgstr "تصدير"

#: admin.py:815
#: admin.py:901
msgid "You must select an export format."
msgstr "يجب تحديد تنسيق التصدير."

#: admin.py:838
#: admin.py:926
#, python-format
msgid "Export selected %(verbose_name_plural)s"
msgstr "تصدير %(verbose_name_plural)s المحددة"
Expand All @@ -57,11 +58,11 @@ msgstr "تصدير %(verbose_name_plural)s المحددة"
msgid "Resource"
msgstr ""

#: forms.py:41
#: forms.py:40
msgid "File to import"
msgstr "ملف للإستيراد"

#: forms.py:44 forms.py:88 forms.py:114
#: forms.py:42 forms.py:83 forms.py:116
msgid "Format"
msgstr "تنسيق"

Expand All @@ -70,7 +71,7 @@ msgid "Home"
msgstr "الرئيسية"

#: templates/admin/import_export/export.html:36
#: templates/admin/import_export/import.html:73
#: templates/admin/import_export/import.html:78
msgid "Submit"
msgstr "إرسال"

Expand All @@ -86,53 +87,53 @@ msgstr ""
msgid "Confirm import"
msgstr "تأكيد الإستيراد"

#: templates/admin/import_export/import.html:43
#: templates/admin/import_export/import.html:44
msgid "This importer will import the following fields: "
msgstr "هذا المستورد سوف يستورد الحقول التالية : "

#: templates/admin/import_export/import.html:83
#: templates/admin/import_export/import.html:114
#: templates/admin/import_export/import.html:89
#: templates/admin/import_export/import.html:120
msgid "Errors"
msgstr "أخطاء"

#: templates/admin/import_export/import.html:94
#: templates/admin/import_export/import.html:100
msgid "Line number"
msgstr "رقم الصطر"

#: templates/admin/import_export/import.html:106
#: templates/admin/import_export/import.html:112
msgid "Some rows failed to validate"
msgstr ""

#: templates/admin/import_export/import.html:108
#: templates/admin/import_export/import.html:114
msgid ""
"Please correct these errors in your data where possible, then reupload it "
"using the form above."
msgstr ""

#: templates/admin/import_export/import.html:113
#: templates/admin/import_export/import.html:119
msgid "Row"
msgstr ""

#: templates/admin/import_export/import.html:140
#: templates/admin/import_export/import.html:146
msgid "Non field specific"
msgstr ""

#: templates/admin/import_export/import.html:163
#: templates/admin/import_export/import.html:169
msgid "Preview"
msgstr "معاينة"

#: templates/admin/import_export/import.html:178
#: templates/admin/import_export/import.html:184
msgid "New"
msgstr "جديد"

#: templates/admin/import_export/import.html:180
#: templates/admin/import_export/import.html:186
msgid "Skipped"
msgstr "تجاهل"

#: templates/admin/import_export/import.html:182
#: templates/admin/import_export/import.html:188
msgid "Delete"
msgstr "حذف"

#: templates/admin/import_export/import.html:184
#: templates/admin/import_export/import.html:190
msgid "Update"
msgstr "تحديث"
53 changes: 27 additions & 26 deletions import_export/locale/bg/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-04-12 18:40+0100\n"
"POT-Creation-Date: 2023-09-12 15:15+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Hristo Gatsinski <gatsinski@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -18,36 +18,37 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: admin.py:214
#: admin.py:241
#, python-format
msgid "%s through import_export"
msgstr "%s чрез import_export"

#: admin.py:220
#: admin.py:248
msgid "Import finished, with {} new and {} updated {}."
msgstr "Импортирането е завършено, с {} нови и {} обновени {}."

#: admin.py:456
#: admin.py:496
#, python-format
msgid ""
"'{type(e).__name__}' encountered while trying to read file. Ensure you have "
"chosen the correct format for the file. "
"%(exc_name)s encountered while trying to read file. Ensure you have chosen "
"the correct format for the file."
msgstr ""

#: admin.py:580 templates/admin/import_export/change_list_import_item.html:5
#: admin.py:650 templates/admin/import_export/change_list_import_item.html:5
#: templates/admin/import_export/import.html:19
msgid "Import"
msgstr "Импортиране"

#: admin.py:752 templates/admin/import_export/change_list_export_item.html:5
#: admin.py:836 templates/admin/import_export/change_list_export_item.html:5
#: templates/admin/import_export/export.html:12
msgid "Export"
msgstr "Експортиране"

#: admin.py:815
#: admin.py:901
msgid "You must select an export format."
msgstr "Трябва да изберете формат за експортиране."

#: admin.py:838
#: admin.py:926
#, python-format
msgid "Export selected %(verbose_name_plural)s"
msgstr "Експортиране на избраните %(verbose_name_plural)s"
Expand All @@ -56,11 +57,11 @@ msgstr "Експортиране на избраните %(verbose_name_plural)s
msgid "Resource"
msgstr ""

#: forms.py:41
#: forms.py:40
msgid "File to import"
msgstr "Файл за импортиране"

#: forms.py:44 forms.py:88 forms.py:114
#: forms.py:42 forms.py:83 forms.py:116
msgid "Format"
msgstr "Формат"

Expand All @@ -69,7 +70,7 @@ msgid "Home"
msgstr "Начало"

#: templates/admin/import_export/export.html:36
#: templates/admin/import_export/import.html:73
#: templates/admin/import_export/import.html:78
msgid "Submit"
msgstr "Изпълни"

Expand All @@ -85,53 +86,53 @@ msgstr ""
msgid "Confirm import"
msgstr "Потвърди импортирането"

#: templates/admin/import_export/import.html:43
#: templates/admin/import_export/import.html:44
msgid "This importer will import the following fields: "
msgstr "Ще бъдат импортирани следните полета: "

#: templates/admin/import_export/import.html:83
#: templates/admin/import_export/import.html:114
#: templates/admin/import_export/import.html:89
#: templates/admin/import_export/import.html:120
msgid "Errors"
msgstr "Грешки"

#: templates/admin/import_export/import.html:94
#: templates/admin/import_export/import.html:100
msgid "Line number"
msgstr "Номер на реда"

#: templates/admin/import_export/import.html:106
#: templates/admin/import_export/import.html:112
msgid "Some rows failed to validate"
msgstr ""

#: templates/admin/import_export/import.html:108
#: templates/admin/import_export/import.html:114
msgid ""
"Please correct these errors in your data where possible, then reupload it "
"using the form above."
msgstr ""

#: templates/admin/import_export/import.html:113
#: templates/admin/import_export/import.html:119
msgid "Row"
msgstr ""

#: templates/admin/import_export/import.html:140
#: templates/admin/import_export/import.html:146
msgid "Non field specific"
msgstr ""

#: templates/admin/import_export/import.html:163
#: templates/admin/import_export/import.html:169
msgid "Preview"
msgstr "Преглед"

#: templates/admin/import_export/import.html:178
#: templates/admin/import_export/import.html:184
msgid "New"
msgstr "Нов"

#: templates/admin/import_export/import.html:180
#: templates/admin/import_export/import.html:186
msgid "Skipped"
msgstr "Пропуснат"

#: templates/admin/import_export/import.html:182
#: templates/admin/import_export/import.html:188
msgid "Delete"
msgstr "Изтрит"

#: templates/admin/import_export/import.html:184
#: templates/admin/import_export/import.html:190
msgid "Update"
msgstr "Обновен"