]> git.openstreetmap.org Git - rails.git/commitdiff
Made GPX notification E-Mails translatable
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 7 Jun 2009 15:50:30 +0000 (15:50 +0000)
committerÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 7 Jun 2009 15:50:30 +0000 (15:50 +0000)
The multiline 'notifier.gpx_notification.success.loaded_successfully'
message is how one should properly do multiline messages to be
embedded into E-Mail. It wraps at 80 columns (if translated correctly)
and isn't as inhererently limited as splitting the E-Mail into one
message per-line like the other notification messages do it.

app/models/notifier.rb
app/views/notifier/_gpx_description.rhtml
app/views/notifier/gpx_failure.rhtml
app/views/notifier/gpx_success.rhtml
config/locales/en.yml

index 9793caee762ad5c7cdb9fc25eb8670a45573a6e4..80a8ae4850a20a8849b25369aab621b2e69450b0 100644 (file)
@@ -33,7 +33,7 @@ class Notifier < ActionMailer::Base
 
   def gpx_success(trace, possible_points)
     common_headers trace.user
-    subject "[OpenStreetMap] GPX Import success"
+    subject I18n.t('notifier.gpx_notification.success.subject')
     body :trace_name => trace.name,
          :trace_points => trace.size,
          :trace_description => trace.description,
@@ -44,7 +44,7 @@ class Notifier < ActionMailer::Base
   def gpx_failure(trace, error)
     common_headers trace.user
     from "webmaster@openstreetmap.org"
-    subject "[OpenStreetMap] GPX Import failure"
+    subject I18n.t('notifier.gpx_notification.failure.subject')
     body :trace_name => trace.name,
          :trace_description => trace.description,
          :trace_tags => trace.tags,
index b31c7744e1d406bfff8e22faa71bfb8a289bb106..2825799197f2a8a3f779c25b02be377342de087f 100644 (file)
@@ -1,14 +1,14 @@
-Hi,
+<%= t'notifier.gpx_notification.greeting' %>
 
-It looks like your GPX file
+<%= t'notifier.gpx_notification.your_gpx_file' %>
 
   <%= @trace_name %>
 
-with the description 
+<%= t'notifier.gpx_notification.with_description' %>
 
   <%= @trace_description %>
 <% if @trace_tags.length>0 %>
-and the following tags:
+<%= t'notifier.gpx_notification.and_the_tags' %>
 <% @trace_tags.each do |tag| %>
   <%= tag.tag.rstrip %><% end %><% else %>
-and no tags.<% end %>
+<%= t'notifier.gpx_notification.and_no_tags' %><% end %>
index 70d5d9b71b52777f8a05891083de031fd46982ef..f59aa3dbbf58056853de136a5311c6b1360fd310 100644 (file)
@@ -1,9 +1,9 @@
 <%= render :partial => "gpx_description" %>
-failed to import. Here's the error:
+<%= t'notifier.gpx_notification.failure.failed_to_import' %>
 
   <%= @error %>
 
-More information about GPX import failures and how to avoid
-them can be found at:
+<%= t'notifier.gpx_notification.failure.more_info_1' %>
+<%= t'notifier.gpx_notification.failure.more_info_2' %>
 
-  http://wiki.openstreetmap.org/wiki/GPX_Import_Failures
+  <%= t'notifier.gpx_notification.failure.import_failures_url' %>
index 2613d742971336e990a8f472ef214c79bd81d8ee..1983fe71c2e563d1ef58ff42c75fb7be1d8c0497 100644 (file)
@@ -1,3 +1,2 @@
 <%= render :partial => "gpx_description" %>
-loaded successfully with <%= @trace_points %> out of a possible
-<%= @possible_points %> points.
+<%= t'notifier.gpx_notification.success.loaded_successfully', :trace_points => @trace_points, :possible_points => @possible_points %>
index ce3d51a5a9e8bc8a5e309f880fea400184729610..acad152e6039bb3226f2801e19cd9926eafee531 100644 (file)
@@ -374,6 +374,23 @@ en:
       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."
+    gpx_notification:
+      greeting: "Hi,"
+      your_gpx_file: "It looks like your GPX file"
+      with_description: "with the description"
+      and_the_tags: "and the following tags:"
+      and_no_tags: "and no tags."
+      failure:
+        subject: "[OpenStreetMap] GPX Import failure"
+        failed_to_import: "failed to import. Here's the error:"
+        more_info_1: "More information about GPX import failures and how to avoid"
+        more_info_2: "them can be found at:"
+        import_failures_url: "http://wiki.openstreetmap.org/wiki/GPX_Import_Failures"
+      success:
+        subject: "[OpenStreetMap] GPX Import success"
+        loaded_successfully: |
+          loaded successfully with {{trace_points}} out of a possible
+          {{possible_points}} points.
     signup_confirm:
       subject: "[OpenStreetMap] Confirm your email address"
     signup_confirm_plain: