diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 10d2fe900..5eaea71ba 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -187,13 +187,23 @@ class Mailer < ActionMailer::Base added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id) added_to = "#{l(:label_document)}: #{container.title}" end + if attachments.length == 1 + title = ": #{attachments[0].filename}" + elsif attachments.length > 1 + title = ": #{l(:label_attachment_count, + :filename => attachments[0].filename, + :count => attachments.length-1)}" + else + # length == 0: never happens + title = "" + end redmine_headers 'Project' => container.project.identifier @attachments = attachments @user = user @added_to = added_to @added_to_url = added_to_url mail :to => user, - :subject => "[#{container.project.name}] #{l(:label_attachment_new)}" + :subject => "[#{container.project.name}] #{l(:label_attachment_new)}#{title}" end # Notifies users about new attachments diff --git a/config/locales/en.yml b/config/locales/en.yml index 657297619..59e0fd04e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1420,3 +1420,4 @@ en: text_user_destroy_confirmation: "Are you sure you want to delete this user and remove all references to them? This cannot be undone. Often, locking a user instead of deleting them is the better solution. To confirm, please enter their login (%{login}) below." text_project_destroy_enter_identifier: "To confirm, please enter the project's identifier (%{identifier}) below." field_name_or_email_or_login: Name, email or login + label_attachment_count: "%{filename} and %{count} files" diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 1faae3deb..3c8adf28c 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1446,3 +1446,4 @@ ja: setting_copy_attachments_on_issue_copy: チケットをコピーするとき添付ファイルもコピー field_thousands_delimiter: 3桁区切り表示 label_involved_principals: 作成者 / 直前担当者 + label_attachment_count: "%{filename}、他%{count}件"