also translate mail subjects

This commit is contained in:
wvengen 2013-05-07 13:28:14 +02:00
parent 305ae9b5c0
commit 0c94ef5912
3 changed files with 20 additions and 7 deletions

View File

@ -26,7 +26,7 @@ class Mailer < ActionMailer::Base
@link = new_password_url(id: @user.id, token: @user.reset_password_token)
mail :to => @user.email,
:subject => "[#{FoodsoftConfig[:name]}] Neues Passwort für/ New password for #{@user.nick}"
:subject => "[#{FoodsoftConfig[:name]}] " + I18n.t('mailer.reset_password.subject', :username => @user.nick)
end
# Sends an invite email.
@ -36,7 +36,7 @@ class Mailer < ActionMailer::Base
@link = accept_invitation_url(token: @invite.token)
mail :to => @invite.email,
:subject => "Einladung in die Foodcoop #{FoodsoftConfig[:name]} - Invitation to the Foodcoop"
:subject => I18n.t('mailer.invite.subject')
end
# Notify user of upcoming task.
@ -46,7 +46,7 @@ class Mailer < ActionMailer::Base
@task = task
mail :to => user.email,
:subject => "[#{FoodsoftConfig[:name]}] Aufgaben werden fällig!"
:subject => "[#{FoodsoftConfig[:name]}] " + I18n.t('mailer.upcoming_tasks.subject')
end
# Sends order result for specific Ordergroup
@ -56,7 +56,7 @@ class Mailer < ActionMailer::Base
@group_order = group_order
mail :to => user.email,
:subject => "[#{FoodsoftConfig[:name]}] Bestellung beendet: #{group_order.order.name}"
:subject => "[#{FoodsoftConfig[:name]}] " + I18n.t('mailer.order_result.subject', :name => group_order.order.name)
end
# Notify user if account balance is less than zero
@ -66,7 +66,7 @@ class Mailer < ActionMailer::Base
@transaction = transaction
mail :to => user.email,
:subject => "[#{FoodsoftConfig[:name]}] Gruppenkonto im Minus"
:subject => "[#{FoodsoftConfig[:name]}] " + I18n.t('mailer.negative_balance')
end
def feedback(user, feedback)
@ -78,7 +78,7 @@ class Mailer < ActionMailer::Base
:from => "#{user.nick} <#{user.email}>",
:sender => FoodsoftConfig[:notification]["sender_address"],
:errors_to => FoodsoftConfig[:notification]["sender_address"],
:subject => "[Foodsoft] Feeback von #{user.email}"
:subject => "[#{FoodsoftConfig[:name]}] " + I18n.t('mailer.feedback.subject', :email => user.email)
end
def not_enough_users_assigned(task, user)
@ -87,7 +87,7 @@ class Mailer < ActionMailer::Base
@user = user
mail :to => user.email,
:subject => "[#{FoodsoftConfig[:name]}] \"#{task.name}\" braucht noch Leute!"
:subject => "[#{FoodsoftConfig[:name]}] " + I18n.t('mailer.not_enough_users_assigned.subject', :task => task.name)
end
private

View File

@ -2,6 +2,7 @@ de:
mailer:
dateformat: '%d. %b'
feedback:
subject: 'Feedback von %{email}'
header: '%{user} schrieb am %{date}:'
foodsoft_message:
footer: |
@ -9,6 +10,7 @@ de:
Nachricht online einsehen: %{msg_url}
Nachrichten-Einstellungen: %{profile_url}
invite:
subject: 'Einlading in die Foodcoop'
text: |
Hallo!
@ -18,6 +20,7 @@ de:
Grüße sendet die Foodsoft!
negative_balance:
subject: 'Gruppenkonto im Minus'
text: |
Liebe %{group},
@ -29,6 +32,7 @@ de:
Viele Grüße von %{foodcoop}
not_enough_users_assigned:
subject: '"%{task}" braucht noch Leute!'
text: |
Liebe(r) %{user},
@ -41,6 +45,7 @@ de:
Deine Aufgaben: %{user_tasks_url}
order_result:
subject: 'Bestellung beendet: %{name}'
text0: |
Liebe %{ordergroup},
@ -54,6 +59,7 @@ de:
Viele Grüße von %{foodcoop}
reset_password:
subject: 'Neues Password für %{username}'
text: |
Hallo %{user},
@ -65,6 +71,7 @@ de:
Grüße sendet die Foodsoft! :)
upcoming_tasks:
subject: 'Aufgaben werden fällig!'
text0: |
Liebe(r) %{user},

View File

@ -2,6 +2,7 @@ en:
mailer:
dateformat: '%d %b'
feedback:
subject: 'Feedback from %{email}'
header: '%{user} wrote at %{date}:'
foodsoft_message:
footer: |
@ -9,6 +10,7 @@ en:
See message online: %{msg_url}
Messaging options: %{profile_url}
invite:
subject: 'Invitation to the Foodcoop'
text: |
Hi!
@ -18,6 +20,7 @@ en:
Greetings, your Foodsoft Team!
negative_balance:
subject: 'Negative account balance'
text: |
Dear %{group},
@ -29,6 +32,7 @@ en:
Kind regards from %{foodcoop}.
not_enough_users_assigned:
subject: '"%{task}" still needs people!'
text: |
Dear %{user},
@ -54,6 +58,7 @@ en:
Kind regards from %{foodcoop}.
reset_password:
subject: 'New password for %{username}'
text: |
Hi %{user},
@ -64,6 +69,7 @@ en:
Greetings, your Foodsoft Team!
upcoming_tasks:
subject: 'Tasks are due!'
text0: |
Dear %{user},