]> git.openstreetmap.org Git - rails.git/commitdiff
Make the rest of the email translatable.
authorTom Hughes <tom@compton.nu>
Fri, 5 Jun 2009 23:53:47 +0000 (23:53 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 5 Jun 2009 23:53:47 +0000 (23:53 +0000)
app/models/notifier.rb
app/views/notifier/email_confirm.text.html.rhtml
app/views/notifier/email_confirm.text.plain.rhtml
app/views/notifier/lost_password.text.html.rhtml
app/views/notifier/lost_password.text.plain.rhtml
app/views/notifier/message_notification.rhtml
app/views/notifier/reset_password.text.html.rhtml
app/views/notifier/reset_password.text.plain.rhtml
config/locales/en.yml

index 4500e527f9914edd454be7fb39e8a647a23518d7..9793caee762ad5c7cdb9fc25eb8670a45573a6e4 100644 (file)
@@ -1,7 +1,7 @@
 class Notifier < ActionMailer::Base
   def signup_confirm(user, token)
     common_headers user
 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)
     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
   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",
     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
 
   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)
     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
 
   def reset_password(user, pass)
     common_headers user
-    subject "[OpenStreetMap] Password reset"
+    subject I18n.t('notifier.reset_password.subject')
     body :pass => pass
   end
 
     body :pass => pass
   end
 
@@ -53,11 +53,11 @@ class Notifier < ActionMailer::Base
   
   def message_notification(message)
     common_headers message.recipient
   
   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,
     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),
          :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
 
   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,
     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
     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",
     body :user => befriender.display_name,
          :userurl => url_for(:host => SERVER_URL,
                              :controller => "user", :action => "view",
index 271a350289612f1807dc99ac722832e977df203d..5b7c74d7f52dd608bcb41569b6db3c5577d6654b 100644 (file)
@@ -1,8 +1,7 @@
-<p>Hi,</p>
+<p><%= t 'notifier.email_confirm_html.greeting' %></p>
 
 
-<p>Someone (hopefully you) would like to change their email address over at
-   <%= SERVER_URL %> to <%= @address %>.</p>
+<p><%= t 'notifier.email_confirm_html.hopefully_you', :server_url => SERVER_URL, :new_address => @address %></p>
 
 
-<p>If this is you, please click the link below to confirm the change.</p>
+<p><%= t 'notifier.email_confirm_html.click_the_link' %></p>
 
 <p><a href="<%= @url %>"><%= @url %></a></p>
 
 <p><a href="<%= @url %>"><%= @url %></a></p>
index 28589dfbc2f36808278b8546ecffedd3bc001bd6..176ef2238ab5c190485293d9a2bf27f659df182a 100644 (file)
@@ -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 %>
 
 <%= @url %>
index 341240ea8199f88f74a7a6b02e6d9e30f815c383..5f1012ac6dcd3ac0d2524a9ac2868fb774e94339 100644 (file)
@@ -1,8 +1,7 @@
-<p>Hi,</p>
+<p><%= t 'notifier.lost_password_html.greeting' %></p>
 
 
-<p>Someone (possibly you) has asked for the password to be reset on this
-   email addresses openstreetmap.org account.</p>
+<p><%= t 'notifier.lost_password_html.hopefully_you' %></p>
 
 
-<p>If this is you, please click the link below to reset your password.</p>
+<p><%= t 'notifier.lost_password_html.click_the_link' %></p>
 
 <p><a href="<%= @url %>"><%= @url %></a></p>
 
 <p><a href="<%= @url %>"><%= @url %></a></p>
index 78d3a51dd4606761cc326e2d0d64ca804a752b06..89381801f8d2beb24ee4e7162241253eaba60826 100644 (file)
@@ -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 %>
 
 <%= @url %>
index 7192e38849dacecef524b7998b049b6a2de2e8b0..4fb23e0a2b95aee0df5bb9fc905f5c0537e9372d 100644 (file)
@@ -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 %>
 ==
 
 
 ==
 <%= @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' %>
 *                                                                         *
 ***************************************************************************
 *                                                                         *
 ***************************************************************************
index a99ca378e439c95f14d1c9b98c1766dfc4fdfbb5..39ea35b5ef4ea4c776247c4738e2c16fd7ef2750 100644 (file)
@@ -1,3 +1,3 @@
-<p>Hi,</p>
+<p><%= t 'notifier.reset_password_html.greeting' %></p>
 
 
-<p>Your password has been reset to <%= @pass %></p>
+<p><%= t 'notifier.reset_password_html.reset', :new_password => @pass %></p>
index 284e565d07ba267005cb499c75c35b58bce07c8a..aab4d137b672b144160a944c3f68a9021c867e29 100644 (file)
@@ -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 %>
index 0a7e589af0b954bd232f4ce278cfa61bb3d092a1..848bb8e6dbc4cb4597aa95a31160de4826388688 100644 (file)
@@ -330,14 +330,26 @@ en:
     alt_donation: Make a Donation
   notifier:
     diary_comment_notification:
     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}}"
       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:
     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."
       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"
     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 <a href="http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page">sign up to the OpenStreetMap wiki</a>.'
       user_wiki_page: 'It is recommended that you create a user wiki page, which includes category tags noting where you are, such as <a href="http://wiki.openstreetmap.org/wiki/Category:Users_in_London">[[Category:Users_in_London]]</a>.'
       current_user: 'A list of current users in categories, based on where in the world they are, is available from <a href="http://wiki.openstreetmap.org/wiki/Category:Users_by_geographical_region">Category:Users_by_geographical_region</a>.'
       wiki_signup: 'You may also want to <a href="http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page">sign up to the OpenStreetMap wiki</a>.'
       user_wiki_page: 'It is recommended that you create a user wiki page, which includes category tags noting where you are, such as <a href="http://wiki.openstreetmap.org/wiki/Category:Users_in_London">[[Category:Users_in_London]]</a>.'
       current_user: 'A list of current users in categories, based on where in the world they are, is available from <a href="http://wiki.openstreetmap.org/wiki/Category:Users_by_geographical_region">Category:Users_by_geographical_region</a>.'
+    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"
   message:
     inbox:
       title: "Inbox"