From d9dbd3edf16335ffd6b9d57d63f55ca98fdc292c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 5 Jun 2009 23:53:47 +0000 Subject: [PATCH] Make the rest of the email translatable. --- app/models/notifier.rb | 16 +++---- .../notifier/email_confirm.text.html.rhtml | 7 ++-- .../notifier/email_confirm.text.plain.rhtml | 8 ++-- .../notifier/lost_password.text.html.rhtml | 7 ++-- .../notifier/lost_password.text.plain.rhtml | 8 ++-- app/views/notifier/message_notification.rhtml | 34 ++++----------- .../notifier/reset_password.text.html.rhtml | 4 +- .../notifier/reset_password.text.plain.rhtml | 4 +- config/locales/en.yml | 42 +++++++++++++++++++ 9 files changed, 76 insertions(+), 54 deletions(-) diff --git a/app/models/notifier.rb b/app/models/notifier.rb index 4500e527f..9793caee7 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -1,7 +1,7 @@ class Notifier < ActionMailer::Base def signup_confirm(user, token) common_headers user - subject "[OpenStreetMap] Confirm your email address" + subject I18n.t('notifier.signup_confirm.subject') body :url => url_for(:host => SERVER_URL, :controller => "user", :action => "confirm", :confirm_string => token.token) @@ -10,7 +10,7 @@ class Notifier < ActionMailer::Base def email_confirm(user, token) common_headers user recipients user.new_email - subject "[OpenStreetMap] Confirm your email address" + subject I18n.t('notifier.email_confirm.subject') body :address => user.new_email, :url => url_for(:host => SERVER_URL, :controller => "user", :action => "confirm_email", @@ -19,7 +19,7 @@ class Notifier < ActionMailer::Base def lost_password(user, token) common_headers user - subject "[OpenStreetMap] Password reset request" + subject I18n.t('notifier.lost_password.subject') body :url => url_for(:host => SERVER_URL, :controller => "user", :action => "reset_password", :email => user.email, :token => token.token) @@ -27,7 +27,7 @@ class Notifier < ActionMailer::Base def reset_password(user, pass) common_headers user - subject "[OpenStreetMap] Password reset" + subject I18n.t('notifier.reset_password.subject') body :pass => pass end @@ -53,11 +53,11 @@ class Notifier < ActionMailer::Base def message_notification(message) common_headers message.recipient - subject "[OpenStreetMap] #{message.sender.display_name} sent you a new message" + subject I18n.t('notifier.message_notification.subject', :user => message.sender.display_name) body :to_user => message.recipient.display_name, :from_user => message.sender.display_name, :body => message.body, - :subject => message.title, + :title => message.title, :readurl => url_for(:host => SERVER_URL, :controller => "message", :action => "read", :message_id => message.id), @@ -68,7 +68,7 @@ class Notifier < ActionMailer::Base def diary_comment_notification(comment) common_headers comment.diary_entry.user - subject "[OpenStreetMap] #{comment.user.display_name} commented on your diary entry" + subject I18n.t('notifier.diary_comment_notification.subject', :user => comment.user.display_name) body :to_user => comment.diary_entry.user.display_name, :from_user => comment.user.display_name, :body => comment.body, @@ -97,7 +97,7 @@ class Notifier < ActionMailer::Base befriendee = User.find_by_id(friend.friend_user_id) common_headers befriendee - subject "[OpenStreetMap] #{befriender.display_name} added you as a friend" + subject I18n.t('notifier.friend_notification.subject', :user => befriender.display_name) body :user => befriender.display_name, :userurl => url_for(:host => SERVER_URL, :controller => "user", :action => "view", diff --git a/app/views/notifier/email_confirm.text.html.rhtml b/app/views/notifier/email_confirm.text.html.rhtml index 271a35028..5b7c74d7f 100644 --- a/app/views/notifier/email_confirm.text.html.rhtml +++ b/app/views/notifier/email_confirm.text.html.rhtml @@ -1,8 +1,7 @@ -

Hi,

+

<%= t 'notifier.email_confirm_html.greeting' %>

-

Someone (hopefully you) would like to change their email address over at - <%= SERVER_URL %> to <%= @address %>.

+

<%= t 'notifier.email_confirm_html.hopefully_you', :server_url => SERVER_URL, :new_address => @address %>

-

If this is you, please click the link below to confirm the change.

+

<%= t 'notifier.email_confirm_html.click_the_link' %>

<%= @url %>

diff --git a/app/views/notifier/email_confirm.text.plain.rhtml b/app/views/notifier/email_confirm.text.plain.rhtml index 28589dfbc..176ef2238 100644 --- a/app/views/notifier/email_confirm.text.plain.rhtml +++ b/app/views/notifier/email_confirm.text.plain.rhtml @@ -1,8 +1,8 @@ -Hi, +<%= t 'notifier.email_confirm_plain.greeting' %> -Someone (hopefully you) would like to change their email address over at -<%= SERVER_URL %> to <%= @address %>. +<%= t 'notifier.email_confirm_plain.hopefully_you_1' %> +<%= t 'notifier.email_confirm_plain.hopefully_you_2', :server_url => SERVER_URL, :new_address => @address %> -If this is you, please click the link below to confirm the change. +<%= t 'notifier.email_confirm_plain.click_the_link' %> <%= @url %> diff --git a/app/views/notifier/lost_password.text.html.rhtml b/app/views/notifier/lost_password.text.html.rhtml index 341240ea8..5f1012ac6 100644 --- a/app/views/notifier/lost_password.text.html.rhtml +++ b/app/views/notifier/lost_password.text.html.rhtml @@ -1,8 +1,7 @@ -

Hi,

+

<%= t 'notifier.lost_password_html.greeting' %>

-

Someone (possibly you) has asked for the password to be reset on this - email addresses openstreetmap.org account.

+

<%= t 'notifier.lost_password_html.hopefully_you' %>

-

If this is you, please click the link below to reset your password.

+

<%= t 'notifier.lost_password_html.click_the_link' %>

<%= @url %>

diff --git a/app/views/notifier/lost_password.text.plain.rhtml b/app/views/notifier/lost_password.text.plain.rhtml index 78d3a51dd..89381801f 100644 --- a/app/views/notifier/lost_password.text.plain.rhtml +++ b/app/views/notifier/lost_password.text.plain.rhtml @@ -1,8 +1,8 @@ -Hi, +<%= t 'notifier.lost_password_plain.greeting' %> -Someone (possibly you) has asked for the password to be reset on this -email addresses openstreetmap.org account. +<%= t 'notifier.lost_password_plain.hopefully_you_1' %> +<%= t 'notifier.lost_password_plain.hopefully_you_2' %> -If this is you, please click the link below to reset your password. +<%= t 'notifier.lost_password_plain.click_the_link' %> <%= @url %> diff --git a/app/views/notifier/message_notification.rhtml b/app/views/notifier/message_notification.rhtml index 7192e3884..4fb23e0a2 100644 --- a/app/views/notifier/message_notification.rhtml +++ b/app/views/notifier/message_notification.rhtml @@ -1,42 +1,24 @@ *************************************************************************** * * -* Please do not reply to this email. * -* Use the OpenStreetMap web site to reply. * -* * -* Bitte antworten Sie nicht auf diese E-Mail. * -* Verwenden Sie die OpenStreetMap Website zum Antworten. * -* * -* Por favor, no responda a este mensaje. * -* Utilice el OpenStreetMap sitio web para responder. * -* * -* S’il vous plaît de ne pas répondre à ce message. * -* Utilisez le OpenStreetMap site Web pour y répondre. * +<%= t'notifier.message_notification.banner1' %> +<%= t'notifier.message_notification.banner2' %> * * *************************************************************************** -Hi <%= @to_user %>, +<%= t'notifier.message_notification.hi', :to_user => @to_user %> -<%= @from_user %> has sent you a message through OpenStreetMap with the subject "<%= @subject %>": +<%= t'notifier.message_notification.header', :from_user => @from_user, :subject => @title %> == <%= @body %> == -You can also read the message at <%= @readurl %> -and you can reply at <%= @replyurl %> +<%= t'notifier.message_notification.footer1', :readurl => @readurl %> +<%= t'notifier.message_notification.footer2', :replyurl => @replyurl %> *************************************************************************** * * -* Please do not reply to this email. * -* Use the OpenStreetMap web site to reply. * -* * -* Bitte antworten Sie nicht auf diese E-Mail. * -* Verwenden Sie die OpenStreetMap Website zum Antworten. * -* * -* Por favor, no responda a este mensaje. * -* Utilice el OpenStreetMap sitio web para responder. * -* * -* S’il vous plaît de ne pas répondre à ce message. * -* Utilisez le OpenStreetMap site Web pour y répondre. * +<%= t'notifier.message_notification.banner1' %> +<%= t'notifier.message_notification.banner2' %> * * *************************************************************************** diff --git a/app/views/notifier/reset_password.text.html.rhtml b/app/views/notifier/reset_password.text.html.rhtml index a99ca378e..39ea35b5e 100644 --- a/app/views/notifier/reset_password.text.html.rhtml +++ b/app/views/notifier/reset_password.text.html.rhtml @@ -1,3 +1,3 @@ -

Hi,

+

<%= t 'notifier.reset_password_html.greeting' %>

-

Your password has been reset to <%= @pass %>

+

<%= t 'notifier.reset_password_html.reset', :new_password => @pass %>

diff --git a/app/views/notifier/reset_password.text.plain.rhtml b/app/views/notifier/reset_password.text.plain.rhtml index 284e565d0..aab4d137b 100644 --- a/app/views/notifier/reset_password.text.plain.rhtml +++ b/app/views/notifier/reset_password.text.plain.rhtml @@ -1,3 +1,3 @@ -Hi, +<%= t 'notifier.reset_password_plain.greeting' %> -Your password has been reset to <%= @pass %> +<%= t 'notifier.reset_password_plain.reset', :new_password => @pass %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 0a7e589af..848bb8e6d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -330,14 +330,26 @@ en: alt_donation: Make a Donation notifier: diary_comment_notification: + subject: "[OpenStreetMap] {{user}} commented on your diary entry" banner1: "* Please do not reply to this email. *" banner2: "* Use the OpenStreetMap web site to reply. *" hi: "Hi {{to_user}}," header: "{{from_user}} has commented on your recent OpenStreetMap diary entry with the subject {{subject}}:" footer: "You can also read the comment at {{readurl}} and you can comment at {{commenturl}} or reply at {{replyurl}}" + message_notification: + subject: "[OpenStreetMap] {{user}} sent you a new message" + banner1: "* Please do not reply to this email. *" + banner2: "* Use the OpenStreetMap web site to reply. *" + hi: "Hi {{to_user}}," + header: "{{from_user}} has sent you a message through OpenStreetMap with the subject {{subject}}:" + footer1: "You can also read the message at {{readurl}}" + footer2: "and you can reply at {{replyurl}}" friend_notification: + subject: "[OpenStreetMap] {{user}} added you as a friend" had_added_you: "{{user}} has added you as a friend on OpenStreetMap." see_their_profile: "You can see their profile at {{userurl}} and add them as a friend too if you wish." + signup_confirm: + subject: "[OpenStreetMap] Confirm your email address" signup_confirm_plain: greeting: "Hi there!" hopefully_you: "Someone (hopefully you) would like to create an account over at" @@ -366,6 +378,36 @@ en: wiki_signup: 'You may also want to sign up to the OpenStreetMap wiki.' user_wiki_page: 'It is recommended that you create a user wiki page, which includes category tags noting where you are, such as [[Category:Users_in_London]].' current_user: 'A list of current users in categories, based on where in the world they are, is available from Category:Users_by_geographical_region.' + email_confirm: + subject: "[OpenStreetMap] Confirm your email address" + email_confirm_plain: + greeting: "Hi," + hopefully_you_1: "Someone (hopefully you) would like to change their email address over at" + hopefully_you_2: "{{server_url}} to {{new_address}}." + click_the_link: "If this is you, please click the link below to confirm the change." + email_confirm_html: + greeting: "Hi," + hopefully_you: "Someone (hopefully you) would like to change their email address over at {{server_url}} to {{new_address}}." + click_the_link: "If this is you, please click the link below to confirm the change." + lost_password: + subject: "[OpenStreetMap] Password reset request" + lost_password_plain: + greeting: "Hi," + hopefully_you_1: "Someone (possibly you) has asked for the password to be reset on this" + hopefully_you_2: "email addresses openstreetmap.org account." + click_the_link: "If this is you, please click the link below to reset your password." + lost_password_html: + greeting: "Hi," + hopefully_you: "Someone (possibly you) has asked for the password to be reset on this email address's openstreetmap.org account." + click_the_link: "If this is you, please click the link below to reset your password." + reset_password: + subject: "[OpenStreetMap] Password reset" + reset_password_plain: + greeting: "Hi," + reset: "Your password has been reset to {{new_password}}" + reset_password_html: + greeting: "Hi," + reset: "Your password has been reset to {{new_password}}" message: inbox: title: "Inbox" -- 2.43.2