From: Ævar Arnfjörð Bjarmason Date: Sun, 7 Jun 2009 15:50:30 +0000 (+0000) Subject: Made GPX notification E-Mails translatable X-Git-Tag: live~7141 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/938cdd8503f9e9257e9b023eb25ed32d6668bf74?hp=2b07fd8b4b7b8906a6a731bf8ed280d0d4a5afcf Made GPX notification E-Mails translatable 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. --- diff --git a/app/models/notifier.rb b/app/models/notifier.rb index 9793caee7..80a8ae485 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -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, diff --git a/app/views/notifier/_gpx_description.rhtml b/app/views/notifier/_gpx_description.rhtml index b31c7744e..282579919 100644 --- a/app/views/notifier/_gpx_description.rhtml +++ b/app/views/notifier/_gpx_description.rhtml @@ -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 %> diff --git a/app/views/notifier/gpx_failure.rhtml b/app/views/notifier/gpx_failure.rhtml index 70d5d9b71..f59aa3dbb 100644 --- a/app/views/notifier/gpx_failure.rhtml +++ b/app/views/notifier/gpx_failure.rhtml @@ -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' %> diff --git a/app/views/notifier/gpx_success.rhtml b/app/views/notifier/gpx_success.rhtml index 2613d7429..1983fe71c 100644 --- a/app/views/notifier/gpx_success.rhtml +++ b/app/views/notifier/gpx_success.rhtml @@ -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 %> diff --git a/config/locales/en.yml b/config/locales/en.yml index ce3d51a5a..acad152e6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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: