diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 10d2fe900..3d4e19c21 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -187,13 +187,21 @@ 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 > 0 + title = l(:label_attachment_count, + :filename => attachments[0].filename, + :count => attachments.length-1) + else + # 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..c1c306af2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1420,3 +1420,7 @@ 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: + zero: ": %{filename}" + one: ": %{filename} and 1 file" + other: ": %{filename} and %{count} files" diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 1faae3deb..ba077ca48 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1446,3 +1446,6 @@ ja: setting_copy_attachments_on_issue_copy: チケットをコピーするとき添付ファイルもコピー field_thousands_delimiter: 3桁区切り表示 label_involved_principals: 作成者 / 直前担当者 + label_attachment_count: + zero: ": %{filename}" + other: ": %{filename}、他%{count}件"