瀏覽代碼

Display more detailed error message when attempting to import malformed CSV file (#34762).

Patch by Go MAEDA.


git-svn-id: http://svn.redmine.org/redmine/trunk@20756 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.2.0
Go MAEDA 3 年之前
父節點
當前提交
72d622dc9f
共有 52 個檔案被更改,包括 73 行新增50 行删除
  1. 1
    1
      app/controllers/imports_controller.rb
  2. 1
    1
      config/locales/ar.yml
  3. 1
    1
      config/locales/az.yml
  4. 1
    1
      config/locales/bg.yml
  5. 1
    1
      config/locales/bs.yml
  6. 1
    1
      config/locales/ca.yml
  7. 1
    1
      config/locales/cs.yml
  8. 1
    1
      config/locales/da.yml
  9. 1
    1
      config/locales/de.yml
  10. 1
    1
      config/locales/el.yml
  11. 1
    1
      config/locales/en-GB.yml
  12. 1
    1
      config/locales/en.yml
  13. 1
    1
      config/locales/es-PA.yml
  14. 1
    1
      config/locales/es.yml
  15. 1
    1
      config/locales/et.yml
  16. 1
    1
      config/locales/eu.yml
  17. 1
    1
      config/locales/fa.yml
  18. 1
    1
      config/locales/fi.yml
  19. 1
    1
      config/locales/fr.yml
  20. 1
    1
      config/locales/gl.yml
  21. 1
    1
      config/locales/he.yml
  22. 1
    1
      config/locales/hr.yml
  23. 1
    1
      config/locales/hu.yml
  24. 1
    1
      config/locales/id.yml
  25. 1
    1
      config/locales/it.yml
  26. 1
    1
      config/locales/ja.yml
  27. 1
    1
      config/locales/ko.yml
  28. 1
    1
      config/locales/lt.yml
  29. 1
    1
      config/locales/lv.yml
  30. 1
    1
      config/locales/mk.yml
  31. 1
    1
      config/locales/mn.yml
  32. 1
    1
      config/locales/nl.yml
  33. 1
    1
      config/locales/no.yml
  34. 1
    1
      config/locales/pl.yml
  35. 1
    1
      config/locales/pt-BR.yml
  36. 1
    1
      config/locales/pt.yml
  37. 1
    1
      config/locales/ro.yml
  38. 1
    1
      config/locales/ru.yml
  39. 1
    1
      config/locales/sk.yml
  40. 1
    1
      config/locales/sl.yml
  41. 1
    1
      config/locales/sq.yml
  42. 1
    1
      config/locales/sr-YU.yml
  43. 1
    1
      config/locales/sr.yml
  44. 1
    1
      config/locales/sv.yml
  45. 1
    1
      config/locales/th.yml
  46. 1
    1
      config/locales/tr.yml
  47. 1
    1
      config/locales/uk.yml
  48. 1
    1
      config/locales/vi.yml
  49. 1
    1
      config/locales/zh-TW.yml
  50. 1
    1
      config/locales/zh.yml
  51. 2
    0
      test/fixtures/files/unclosed_quoted_field.csv
  52. 21
    0
      test/functional/imports_controller_test.rb

+ 1
- 1
app/controllers/imports_controller.rb 查看文件

@@ -55,7 +55,7 @@ class ImportsController < ApplicationController

rescue CSV::MalformedCSVError, EncodingError => e
if e.is_a?(CSV::MalformedCSVError) && e.message !~ /Invalid byte sequence/
flash.now[:error] = l(:error_invalid_csv_file_or_settings)
flash.now[:error] = l(:error_invalid_csv_file_or_settings, e.message)
else
flash.now[:error] = l(:error_invalid_file_encoding, :encoding => ERB::Util.h(@import.settings['encoding']))
end

+ 1
- 1
config/locales/ar.yml 查看文件

@@ -1139,7 +1139,7 @@ ar:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/az.yml 查看文件

@@ -1231,7 +1231,7 @@ az:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/bg.yml 查看文件

@@ -224,7 +224,7 @@ bg:
warning_attachments_not_saved: "%{count} файла не бяха записани."
error_password_expired: Вашата парола е с изтекъл срок или администраторът изисква да я смените.
error_invalid_file_encoding: Файлът няма валидно %{encoding} кодиране.
error_invalid_csv_file_or_settings: Файлът не е CSV файл или не съответства на зададеното по-долу
error_invalid_csv_file_or_settings: Файлът не е CSV файл или не съответства на зададеното по-долу (%{value})
error_can_not_read_import_file: Грешка по време на четене на импортирания файл
error_attachment_extension_not_allowed: Файлове от тип %{extension} не са позволени
error_ldap_bind_credentials: Невалидни LDAP име/парола

+ 1
- 1
config/locales/bs.yml 查看文件

@@ -1152,7 +1152,7 @@ bs:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/ca.yml 查看文件

@@ -1134,7 +1134,7 @@ ca:
notice_import_finished: "%{count} element/s han sigut importats"
notice_import_finished_with_errors: "%{count} de %{total} elements no s'ha pogut importar"
error_invalid_file_encoding: "El fitxer no utilitza una codificació valida (%{encoding})"
error_invalid_csv_file_or_settings: "El fitxer no es un CSV o no coincideix amb la configuració"
error_invalid_csv_file_or_settings: "El fitxer no es un CSV o no coincideix amb la configuració (%{value})"
error_can_not_read_import_file: "S'ha produït un error mentre es llegia el fitxer a importar"
permission_import_issues: "Importar assumptes"
label_import_issues: "Importar assumptes"

+ 1
- 1
config/locales/cs.yml 查看文件

@@ -1139,7 +1139,7 @@ cs:
notice_import_finished_with_errors: "%{count} z %{total} položek nemohlo být naimportováno"
error_invalid_file_encoding: Soubor není platným souborem s kódováním %{encoding}
error_invalid_csv_file_or_settings: Soubor není CSV soubor nebo neodpovídá
níže uvedenému nastavení
níže uvedenému nastavení (%{value})
error_can_not_read_import_file: Chyba při čtení souboru pro import
permission_import_issues: Import úkolů
label_import_issues: Import úkolů

+ 1
- 1
config/locales/da.yml 查看文件

@@ -1156,7 +1156,7 @@ da:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/de.yml 查看文件

@@ -1178,7 +1178,7 @@ de:
notice_import_finished: "%{count} Einträge wurden importiert"
notice_import_finished_with_errors: "%{count} von %{total} Einträgen konnten nicht importiert werden"
error_invalid_file_encoding: Die Datei ist keine gültige %{encoding}-kodierte Datei
error_invalid_csv_file_or_settings: Die Datei ist keine CSV-Datei oder entspricht nicht den unten stehenden Einstellungen
error_invalid_csv_file_or_settings: Die Datei ist keine CSV-Datei oder entspricht nicht den unten stehenden Einstellungen (%{value})
error_can_not_read_import_file: Beim Einlesen der Datei ist ein Fehler aufgetreten
permission_import_issues: Tickets importieren
label_import_issues: Tickets importieren

+ 1
- 1
config/locales/el.yml 查看文件

@@ -1139,7 +1139,7 @@ el:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/en-GB.yml 查看文件

@@ -1146,7 +1146,7 @@ en-GB:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/en.yml 查看文件

@@ -221,7 +221,7 @@ en:
warning_attachments_not_saved: "%{count} file(s) could not be saved."
error_password_expired: "Your password has expired or the administrator requires you to change it."
error_invalid_file_encoding: "The file is not a valid %{encoding} encoded file"
error_invalid_csv_file_or_settings: "The file is not a CSV file or does not match the settings below"
error_invalid_csv_file_or_settings: "The file is not a CSV file or does not match the settings below (%{value})"
error_can_not_read_import_file: "An error occurred while reading the file to import"
error_attachment_extension_not_allowed: "Attachment extension %{extension} is not allowed"
error_ldap_bind_credentials: "Invalid LDAP Account/Password"

+ 1
- 1
config/locales/es-PA.yml 查看文件

@@ -1174,7 +1174,7 @@ es-PA:
notice_import_finished_with_errors: "%{count} de %{total} elementos no pudieron ser importados"
error_invalid_file_encoding: El archivo no utiliza %{encoding} válida
error_invalid_csv_file_or_settings: El archivo no es un archivo CSV o no coincide con la
configuración
configuración (%{value})
error_can_not_read_import_file: Ocurrió un error mientras se leía el archivo a importar
permission_import_issues: Importar incidencias
label_import_issues: Importar incidencias

+ 1
- 1
config/locales/es.yml 查看文件

@@ -1172,7 +1172,7 @@ es:
notice_import_finished_with_errors: "%{count} de %{total} elementos no pudieron ser importados"
error_invalid_file_encoding: El archivo no utiliza %{encoding} válida
error_invalid_csv_file_or_settings: El archivo no es un archivo CSV o no coincide con la
configuración
configuración (%{value})
error_can_not_read_import_file: Ocurrió un error mientras se leía el archivo a importar
permission_import_issues: Importar Peticiones
label_import_issues: Importar petición

+ 1
- 1
config/locales/et.yml 查看文件

@@ -1144,7 +1144,7 @@ et:
notice_import_finished: "%{count} rida imporditud"
notice_import_finished_with_errors: "%{count} rida %{total}st ei õnnestunud importida"
error_invalid_file_encoding: "See fail ei ole õige %{encoding} kodeeringuga"
error_invalid_csv_file_or_settings: "See fail kas ei ole CSV formaadis või ei klapi allolevate sätetega"
error_invalid_csv_file_or_settings: "See fail kas ei ole CSV formaadis või ei klapi allolevate sätetega (%{value})"
error_can_not_read_import_file: "Importfaili sisselugemisel ilmnes viga"
permission_import_issues: "Impordi teemasid"
label_import_issues: "Impordi teemad"

+ 1
- 1
config/locales/eu.yml 查看文件

@@ -1140,7 +1140,7 @@ eu:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/fa.yml 查看文件

@@ -218,7 +218,7 @@ fa:
warning_attachments_not_saved: "%{count} پرونده نتوانست ذخیره شود."
error_password_expired: "گذرواژه‌ی شما منقضی شده است یا راه‌بر درخواست تغییر آن را داده است."
error_invalid_file_encoding: "این پرونده یک پرونده با کدگذاری %{encoding} نیست"
error_invalid_csv_file_or_settings: "این پرونده یک پرونده CSV نیست یا با تنظیمات زیر همخوان نیست."
error_invalid_csv_file_or_settings: "این پرونده یک پرونده CSV نیست یا با تنظیمات زیر همخوان نیست. (%{value})"
error_can_not_read_import_file: "در هنگام خواندن پرونده برای ورود، خطایی رخ داد"
error_attachment_extension_not_allowed: "پسوند %{extension} برای پیوست یک پسوند مجاز نیست"
error_ldap_bind_credentials: "حساب/گذرواژه نامعتبر LDAP"

+ 1
- 1
config/locales/fi.yml 查看文件

@@ -1160,7 +1160,7 @@ fi:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/fr.yml 查看文件

@@ -234,7 +234,7 @@ fr:
warning_attachments_not_saved: "%{count} fichier(s) n'ont pas pu être sauvegardés."
error_password_expired: "Votre mot de passe a expiré ou nécessite d'être changé."
error_invalid_file_encoding: "Le fichier n'est pas un fichier %{encoding} valide"
error_invalid_csv_file_or_settings: "Le fichier n'est pas un fichier CSV ou n'est pas conforme aux paramètres sélectionnés"
error_invalid_csv_file_or_settings: "Le fichier n'est pas un fichier CSV ou n'est pas conforme aux paramètres sélectionnés (%{value})"
error_can_not_read_import_file: "Une erreur est survenue lors de la lecture du fichier à importer"
error_attachment_extension_not_allowed: "L'extension %{extension} n'est pas autorisée"
error_ldap_bind_credentials: "Identifiant ou mot de passe LDAP incorrect"

+ 1
- 1
config/locales/gl.yml 查看文件

@@ -1147,7 +1147,7 @@ gl:
notice_import_finished_with_errors: "%{count} dun total de %{total} elementos non puideron ser importados"
error_invalid_file_encoding: O ficheiro non é un ficheiro codificado %{encoding} válido
error_invalid_csv_file_or_settings: O ficheiro non é un arquivo CSV ou non coincide coas
opcións de abaixo
opcións de abaixo (%{value})
error_can_not_read_import_file: Aconteceu un erro lendo o ficheiro a importar
permission_import_issues: Importar peticións
label_import_issues: Importar peticións

+ 1
- 1
config/locales/he.yml 查看文件

@@ -1144,7 +1144,7 @@ he:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/hr.yml 查看文件

@@ -1136,7 +1136,7 @@ hr:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/hu.yml 查看文件

@@ -1158,7 +1158,7 @@
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/id.yml 查看文件

@@ -1141,7 +1141,7 @@ id:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/it.yml 查看文件

@@ -1134,7 +1134,7 @@ it:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Importa segnalazioni

+ 1
- 1
config/locales/ja.yml 查看文件

@@ -1162,7 +1162,7 @@ ja:
notice_import_finished: "%{count}件のデータをすべてインポートしました"
notice_import_finished_with_errors: "全%{total}件中%{count}件のデータがインポートできませんでした"
error_invalid_file_encoding: このファイルのエンコーディングは正しい%{encoding}ではありません
error_invalid_csv_file_or_settings: このファイルはCSVファイルではないか、以下の設定と一致していません
error_invalid_csv_file_or_settings: このファイルはCSVファイルではないか、以下の設定と一致していません (%{value})
error_can_not_read_import_file: インポート元のファイルを読み込み中にエラーが発生しました
permission_import_issues: チケットのインポート
label_import_issues: チケットのインポート

+ 1
- 1
config/locales/ko.yml 查看文件

@@ -1180,7 +1180,7 @@ ko:
notice_import_finished: "총 %{count} 건을 가져왔습니다"
notice_import_finished_with_errors: "총 %{total} 건 중 %{count} 건을 가져오지 못했습니다"
error_invalid_file_encoding: 이 파일은 정상적인 %{encoding} 파일이 아닙니다.
error_invalid_csv_file_or_settings: 이 파일은 CSV 파일이 아니거나 아래 조건에 맞지 않습니다.
error_invalid_csv_file_or_settings: 이 파일은 CSV 파일이 아니거나 아래 조건에 맞지 않습니다. (%{value})
error_can_not_read_import_file: 가져오기 파일을 읽을 수 없습니다.
permission_import_issues: 일감 가져오기
label_import_issues: 일감 가져오기

+ 1
- 1
config/locales/lt.yml 查看文件

@@ -218,7 +218,7 @@ lt:
warning_attachments_not_saved: "%{count} byla(-ų) negali būti išsaugota."
error_password_expired: "Jūsų slaptažodžio galiojimo laikas baigėsi arba administratorius reikalauja jūsų jį pasikeisti"
error_invalid_file_encoding: "Failas nėra tinkamas %{encoding} koduotės failas"
error_invalid_csv_file_or_settings: "Failas nėra CSV failas arba neatitinka žemiau esančių nustatymų"
error_invalid_csv_file_or_settings: "Failas nėra CSV failas arba neatitinka žemiau esančių nustatymų (%{value})"
error_can_not_read_import_file: "Iškilo klaida skaitant importuojamą failą"
error_attachment_extension_not_allowed: "Priedo plėtinys %{extension} negalimas"
error_ldap_bind_credentials: "Netinkamas LDAP Vartotojo vardas/Slaptažodis"

+ 1
- 1
config/locales/lv.yml 查看文件

@@ -1133,7 +1133,7 @@ lv:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/mk.yml 查看文件

@@ -1139,7 +1139,7 @@ mk:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/mn.yml 查看文件

@@ -1139,7 +1139,7 @@ mn:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/nl.yml 查看文件

@@ -1116,7 +1116,7 @@ nl:
notice_import_finished: "%{count} items werden geïmporteerd"
notice_import_finished_with_errors: "%{count} van in totaal %{total} items kunnen niet geïmporteerd worden"
error_invalid_file_encoding: Het bestand is geen geldig geëncodeerd %{encoding} bestand
error_invalid_csv_file_or_settings: Het bestand is geen CSV-bestand of voldoet niet aan onderstaande instellingen
error_invalid_csv_file_or_settings: Het bestand is geen CSV-bestand of voldoet niet aan onderstaande instellingen (%{value})
error_can_not_read_import_file: Er is een fout opgetreden bij het inlezen van het bestand
permission_import_issues: Issues importeren
label_import_issues: Issues importeren

+ 1
- 1
config/locales/no.yml 查看文件

@@ -1129,7 +1129,7 @@
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/pl.yml 查看文件

@@ -1152,7 +1152,7 @@ pl:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/pt-BR.yml 查看文件

@@ -1157,7 +1157,7 @@ pt-BR:
notice_import_finished_with_errors: "%{count} fora de %{total} não puderam ser importados"
error_invalid_file_encoding: O arquivo não é válido %{encoding} é a codificação do arquivo
error_invalid_csv_file_or_settings: O arquivo não é um arquivo CSV ou não corresponde às
definições abaixo
definições abaixo (%{value})
error_can_not_read_import_file: Ocorreu um erro ao ler o arquivo para importação
permission_import_issues: Importar tarefas
label_import_issues: Importar tarefas

+ 1
- 1
config/locales/pt.yml 查看文件

@@ -1139,7 +1139,7 @@ pt:
notice_import_finished: "%{count} registos foram importados"
notice_import_finished_with_errors: "%{count} de %{total} registos não poderam ser importados"
error_invalid_file_encoding: 'O ficheiro não possui a codificação correcta: {encoding}'
error_invalid_csv_file_or_settings: O ficheiro não é um ficheiro CSV ou não respeita as definições abaixo
error_invalid_csv_file_or_settings: O ficheiro não é um ficheiro CSV ou não respeita as definições abaixo (%{value})
error_can_not_read_import_file: Ocorreu um erro ao ler o ficheiro a importar
permission_import_issues: Importar tarefas
label_import_issues: Importar tarefas

+ 1
- 1
config/locales/ro.yml 查看文件

@@ -1134,7 +1134,7 @@ ro:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/ru.yml 查看文件

@@ -1238,7 +1238,7 @@ ru:
notice_import_finished: "%{count} элемент(а, ов) были импортированы"
notice_import_finished_with_errors: "%{count} из %{total} элемент(а, ов) не могут быть импортированы"
error_invalid_file_encoding: Кодировка файла не соответствует выбранной %{encoding}
error_invalid_csv_file_or_settings: Файл не является файлом CSV или не соответствует представленным настройкам
error_invalid_csv_file_or_settings: Файл не является файлом CSV или не соответствует представленным настройкам (%{value})
error_can_not_read_import_file: Во время чтения файла для импорта произошла ошибка
permission_import_issues: Импорт задач
label_import_issues: Импорт задач

+ 1
- 1
config/locales/sk.yml 查看文件

@@ -1128,7 +1128,7 @@ sk:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/sl.yml 查看文件

@@ -1139,7 +1139,7 @@ sl:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/sq.yml 查看文件

@@ -1135,7 +1135,7 @@ sq:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/sr-YU.yml 查看文件

@@ -1141,7 +1141,7 @@ sr-YU:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/sr.yml 查看文件

@@ -1140,7 +1140,7 @@ sr:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/sv.yml 查看文件

@@ -1172,7 +1172,7 @@ sv:
notice_import_finished_with_errors: "%{count} av %{total} artiklar kunde inte importeras"
error_invalid_file_encoding: Filen är inte en %{encoding}-kodad fil
error_invalid_csv_file_or_settings: Filen är inte en CSV-fil eller stämmer inte med
inställningarna nedan
inställningarna nedan (%{value})
error_can_not_read_import_file: Fel vid läsning av fil att importera
permission_import_issues: Importera ärenden
label_import_issues: Importera ärenden

+ 1
- 1
config/locales/th.yml 查看文件

@@ -1135,7 +1135,7 @@ th:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/tr.yml 查看文件

@@ -1146,7 +1146,7 @@ tr:
notice_import_finished: "%{count} kayıt içeri aktarıldı"
notice_import_finished_with_errors: "%{total} kayıttan %{count} tanesi aktarılamadı"
error_invalid_file_encoding: Dosyanın karakter kodlaması geçerli bir %{encoding} kodlaması değil.
error_invalid_csv_file_or_settings: Dosya CSV dosyası değil veya aşağıdaki ayarlara uymuyor
error_invalid_csv_file_or_settings: Dosya CSV dosyası değil veya aşağıdaki ayarlara uymuyor (%{value})
error_can_not_read_import_file: İçeri aktarılacak dosyayı okurken bir hata oluştu
permission_import_issues: İşleri içeri aktarma
label_import_issues: İşleri içeri aktar

+ 1
- 1
config/locales/uk.yml 查看文件

@@ -1140,7 +1140,7 @@ uk:
notice_import_finished: "%{count} елементи(ів) було імпортовано"
notice_import_finished_with_errors: "%{count} з %{total} елементи(ів) неможливо імпортувати"
error_invalid_file_encoding: Кодування файлу не відповідає видраній(ому) %{encoding}
error_invalid_csv_file_or_settings: Файл не є файлом CSV або не відповідає вибраним налаштуванням
error_invalid_csv_file_or_settings: Файл не є файлом CSV або не відповідає вибраним налаштуванням (%{value})
error_can_not_read_import_file: Під час читання файлу для імпорту виникла помилка
permission_import_issues: Імпорт задач
label_import_issues: Імпорт задач

+ 1
- 1
config/locales/vi.yml 查看文件

@@ -1191,7 +1191,7 @@ vi:
notice_import_finished_with_errors: "%{count} out of %{total} items could not be imported"
error_invalid_file_encoding: The file is not a valid %{encoding} encoded file
error_invalid_csv_file_or_settings: The file is not a CSV file or does not match the
settings below
settings below (%{value})
error_can_not_read_import_file: An error occurred while reading the file to import
permission_import_issues: Import issues
label_import_issues: Import issues

+ 1
- 1
config/locales/zh-TW.yml 查看文件

@@ -298,7 +298,7 @@
warning_attachments_not_saved: "%{count} 個附加檔案無法被儲存。"
error_password_expired: "您的密碼已經過期或是管理員要求您變更密碼."
error_invalid_file_encoding: "這個檔案不是一個有效的 %{encoding} 編碼檔案"
error_invalid_csv_file_or_settings: "這個檔案不是一個 CSV 檔案,或是未符合下面所列之設定值"
error_invalid_csv_file_or_settings: "這個檔案不是一個 CSV 檔案,或是未符合下面所列之設定值 (%{value})"
error_can_not_read_import_file: "讀取匯入檔案時發生錯誤"
error_attachment_extension_not_allowed: "附件之附檔名不允許使用 %{extension}"
error_ldap_bind_credentials: "無效的 LDAP 帳號/密碼"

+ 1
- 1
config/locales/zh.yml 查看文件

@@ -1135,7 +1135,7 @@ zh:
notice_import_finished: 成功导入 %{count} 个项目
notice_import_finished_with_errors: 有 %{count} 个项目无法导入(共计 %{total} 个)
error_invalid_file_encoding: 这不是一个有效的 %{encoding} 编码文件
error_invalid_csv_file_or_settings: 这不是一个CSV文件或者不符合以下设置
error_invalid_csv_file_or_settings: 这不是一个CSV文件或者不符合以下设置 (%{value})
error_can_not_read_import_file: 读取导入文件时发生错误
permission_import_issues: 问题导入
label_import_issues: 问题导入

+ 2
- 0
test/fixtures/files/unclosed_quoted_field.csv 查看文件

@@ -0,0 +1,2 @@
subject;description
foo;"Unclosed quoted field

+ 21
- 0
test/functional/imports_controller_test.rb 查看文件

@@ -159,6 +159,27 @@ class ImportsControllerTest < Redmine::ControllerTest
assert_select 'div#flash_error', /not a valid Shift_JIS encoded file/
end

def test_post_settings_with_mailformed_csv_should_display_error
import = generate_import('unclosed_quoted_field.csv')

post(
:settings,
:params => {
:id => import.to_param,
:import_settings => {
:separator => ';',
:wrapper => '"',
:encoding => 'US-ASCII'
}
}
)
assert_response 200
import.reload
assert_nil import.total_items

assert_select 'div#flash_error', /The file is not a CSV file or does not match the settings below \([[:print:]]+\)/
end

def test_get_mapping_should_display_mapping_form
import = generate_import('import_iso8859-1.csv')
import.settings = {'separator' => ";", 'wrapper' => '"', 'encoding' => "ISO-8859-1"}

Loading…
取消
儲存