From 0a363a73b040d26cc6a8774e5f66856260f1baca Mon Sep 17 00:00:00 2001 From: MrZYX Date: Sun, 7 Nov 2010 22:46:06 +0100 Subject: [PATCH] just found the mailer... :) --- .../mailer/confirmation_instructions.html.haml | 6 +++--- app/views/devise/mailer/invitation.html.haml | 14 +++++++------- .../reset_password_instructions.html.haml | 10 +++++----- .../mailer/unlock_instructions.html.haml | 8 ++++---- app/views/notifier/new_request.html.haml | 12 ++++++------ app/views/notifier/new_request.text.haml | 12 ++++++------ app/views/notifier/request_accepted.html.haml | 10 +++++----- app/views/notifier/request_accepted.text.haml | 10 +++++----- config/locales/devise/devise.en.yml | 18 ++++++++++++++++++ config/locales/diaspora/en.yml | 8 ++++++++ 10 files changed, 67 insertions(+), 41 deletions(-) diff --git a/app/views/devise/mailer/confirmation_instructions.html.haml b/app/views/devise/mailer/confirmation_instructions.html.haml index 0dd9d28c0..4856f9471 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.haml +++ b/app/views/devise/mailer/confirmation_instructions.html.haml @@ -46,6 +46,6 @@ = image_tag '/images/diaspora_white.png' #container %p - Welcome #{@resource.email}! - %p You can confirm your account through the link below: - %p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token), :class => "large_text" + = t('devise.mailer.welcome', :email => @resource.email) + %p = t('.you_can_confirm') + %p= link_to t('.confirm'), confirmation_url(@resource, :confirmation_token => @resource.confirmation_token), :class => "large_text" diff --git a/app/views/devise/mailer/invitation.html.haml b/app/views/devise/mailer/invitation.html.haml index 4dd82e773..ef582749e 100644 --- a/app/views/devise/mailer/invitation.html.haml +++ b/app/views/devise/mailer/invitation.html.haml @@ -47,20 +47,20 @@ #container - @invs = @resource.invitations_to_me %p - Hello #{@resource.email}! + = t('devise.mailer.welcome', :email => @resource.email) %p - if @invs.count == 1 - = @invs.first.real_name + " (#{@invs.first.diaspora_handle})" + " has" + = t('.has_invited_you', :name => @invs.first.real_name + " (#{@invs.first.diaspora_handle})") - else - = (@invs.map{|inv| inv.from.real_name + " (#{inv.from.diaspora_handle})"}.join(",") + " have") - = "invited you to join Diaspora at #{root_url}, you can accept it through the link below." + = t('.have_invited_you', :names => (@invs.map{|inv| inv.from.real_name + " (#{inv.from.diaspora_handle})"}.join(","))) + = t('.accept_at', :url => root_url) - @invs.each do |inv| - if inv.message = "#{inv.from.real_name}:" = "\"#{inv.message}\"" %p - %p= link_to 'Accept invitation', accept_invitation_url(@resource, :invitation_token => @resource.invitation_token), :class => "large_text" + %p= link_to t('.accept'), accept_invitation_url(@resource, :invitation_token => @resource.invitation_token), :class => "large_text" %p.small - If you don't want to accept the invitation, please ignore this email. + = t('.ignore') %br/ - Your account won't be created until you access the link above and sign up. + = t('.no_account_till') diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml index 4b344d44e..517333444 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ b/app/views/devise/mailer/reset_password_instructions.html.haml @@ -46,8 +46,8 @@ = image_tag '/images/diaspora_white.png' #container %p - Hello #{@resource.email}! - %p Someone has requested a link to change your password, and you can do this through the link below. - %p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token), :class => "large_text" - %p Your password won't change until you access the link above and create a new one. - %p.small If you didn't request this, please ignore this email. + = t('devise.mailer.hello', :email => @resource.email) + %p = t('.someone_requested') + %p= link_to t('.change'), edit_password_url(@resource, :reset_password_token => @resource.reset_password_token), :class => "large_text" + %p = t('.wont_change') + %p.small = t('.ignore') diff --git a/app/views/devise/mailer/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml index 6fff6bfce..d6359afea 100644 --- a/app/views/devise/mailer/unlock_instructions.html.haml +++ b/app/views/devise/mailer/unlock_instructions.html.haml @@ -46,7 +46,7 @@ = image_tag '/images/diaspora_white.png' #container %p - Hello #{@resource.email}! - %p Your account has been locked due to an excessive amount of unsuccessful sign in attempts. - %p Click the link below to unlock your account: - %p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token), :class => "large_text" + = t('devise.mailer.hello', :email => @resource.email) + %p = t('.account_locked') + %p = t('.click_to_unlock') + %p= link_to t('.unlock'), unlock_url(@resource, :unlock_token => @resource.unlock_token), :class => "large_text" diff --git a/app/views/notifier/new_request.html.haml b/app/views/notifier/new_request.html.haml index 1a994695a..bf964dbda 100644 --- a/app/views/notifier/new_request.html.haml +++ b/app/views/notifier/new_request.html.haml @@ -46,14 +46,14 @@ = image_tag attachments['diaspora_white_on_grey.png'].url, :alt => "DIASPORA" #container %p - Hello #{@receiver.profile.first_name}! + = t('notifier.hello', => :name) %p = "#{@sender.real_name} (#{@sender.diaspora_handle})" - just sent you a friend request on Diaspora* - You should really think about checking it out. + = t('.just_sent_you') + = t('.try_it_out') %br - = link_to "sign in here", new_user_session_url + = link_to t('.sign_in'), new_user_session_url %br - love, + = t('notifier.love'), %br - the diaspora email robot + = t('notifier.diaspora') diff --git a/app/views/notifier/new_request.text.haml b/app/views/notifier/new_request.text.haml index 8ab5bc570..9d4f6e957 100644 --- a/app/views/notifier/new_request.text.haml +++ b/app/views/notifier/new_request.text.haml @@ -1,9 +1,9 @@ -= "hey #{@receiver.profile.first_name}," += t('notifier.hello', :name => @receiver.profile.first_name) = "#{@sender.real_name} (#{@sender.diaspora_handle})" -just sent you a friend request on Diaspora* -You should really think about checking it out. += t('notifier.new_request.just_sent_you') += t('notifier.new_request.try_it_out') -= "sign in here: #{new_user_session_url}" += "#{t('notifier.new_request.sign_in')}: #{new_user_session_url}" -love, -the diaspora email robot += t('notifier.love') += t('notifier.diaspora') diff --git a/app/views/notifier/request_accepted.html.haml b/app/views/notifier/request_accepted.html.haml index 15ca54647..9c4468916 100644 --- a/app/views/notifier/request_accepted.html.haml +++ b/app/views/notifier/request_accepted.html.haml @@ -46,14 +46,14 @@ = image_tag attachments['diaspora_white_on_grey.png'].url, :alt => "DIASPORA" #container %p - Hello #{@receiver.profile.first_name}! + = t('notifier.hello', :name => @receiver.profile.first_name %p = "#{@sender.real_name} (#{@sender.diaspora_handle})" - has accepted your friend request. They are now in your + = t('.accepted') = link_to @aspect.name, aspect_url(@aspect) - aspect. + = t('.aspect') %br - love, + = t('notifier.love') %br - the diaspora email robot + = t('notifier.diaspora') diff --git a/app/views/notifier/request_accepted.text.haml b/app/views/notifier/request_accepted.text.haml index e10623f16..334a68ddf 100644 --- a/app/views/notifier/request_accepted.text.haml +++ b/app/views/notifier/request_accepted.text.haml @@ -1,9 +1,9 @@ -= "hey #{@receiver.profile.first_name}," += t('notifier.hello', :name => @receiver.profile.first_name = "#{@sender.real_name} (#{@sender.diaspora_handle})" -has accepted your friend request. They are now in your -= "#{@aspect.name} asepct.\n" += t('notifier.request_accepted.accepted') += "#{@aspect.name} #{t('notifier.request_accepted.aspect')}\n" = "#{aspect_url(@aspect)}" -love, \n -the diaspora email robot += "#{t('notifier.love')} \n" += t('notifier.diaspora') diff --git a/config/locales/devise/devise.en.yml b/config/locales/devise/devise.en.yml index d47a44051..42d49223a 100644 --- a/config/locales/devise/devise.en.yml +++ b/config/locales/devise/devise.en.yml @@ -21,6 +21,7 @@ en: password: 'Password' sign_in: 'Sign in' have_a_problem: "Have a problem? Find an answer here" + remember_me: "Remember me" signed_in: 'Signed in successfully.' signed_out: 'Signed out successfully.' passwords: @@ -44,14 +45,31 @@ en: invitation_token_invalid: 'The invitation token provided is not valid!' updated: 'Your password was set successfully. You are now signed in.' mailer: + welcome: "Welcome %{email}!" + hello: "Hello %{email}!" confirmation_instructions: subject: 'Confirmation instructions' + you_can_confirm: "You can confirm your account through the link below:" + confirm: "Confirm my account" reset_password_instructions: subject: 'Reset password instructions' + someone_requested: "Someone has requested a link to change your password, and you can do this through the link below." + change: "Change my password" + wont_change: "Your password won't change until you access the link above and create a new one." + ignore: "If you didn't request this, please ignore this email." unlock_instructions: subject: 'Unlock Instructions' + account_locked: "Your account has been locked due to an excessive amount of unsuccessful sign in attempts." + click_to_unlock: "Click the link below to unlock your account:" + unlock: "Unlock my account" invitation: subject: 'A friend wants you to join Diaspora!' + has_invited_you: "%{name} has invited you to join Diaspora" + have_invited_you: "%{names} have invited you to join Diaspora" + accept_at: ", at %{url}, you can accept it through the link below." + accept: "Accept invitation" + ignore: "If you don't want to accept the invitation, please ignore this email." + no_account_till: "Your account won't be created until you access the link above and sign up." shared: links: sign_in: 'Sign in' diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index a8cf0acbd..34d76aa3f 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -312,9 +312,17 @@ en: helper: home: "Home" notifier: + hello: "Hello %{name}!" + love: "love," + diaspora: "the diaspora email robot" new_request: subject: "new Diaspora* friend request from %{from}" + just_sent_you: "just sent you a friend request on Diaspora*" + try_it_out: "You should really think about checking it out." + sign_in: "sign in here" request_accepted: subject: "%{name} has accepted your friend request on Diaspora*" + accepted: "has accepted your friend request. They are now in your" + aspect: "aspect." date: order: [:month, :day, :year]