Merge remote-tracking branch 'upstream/pull/5487'

This commit is contained in:
Tom Hughes 2025-01-09 18:08:31 +00:00
commit a6c6f26acb
8 changed files with 55 additions and 39 deletions

View file

@ -1,9 +1,16 @@
<% trace_name = tag.strong(@trace_name) %> <p><%= t ".details" %></p>
<% trace_name = link_to(trace_name, @trace_url) if @trace_url %>
<% trace_description = tag.em(@trace_description) %> <dl>
<% if @trace_tags.length > 0 %> <dt><%= t ".filename" %>
<% tags = safe_join @trace_tags.map { |trace_tag| tag.em trace_tag.tag }, ", " %> <% if @trace_url %>
<%= t ".description_with_tags_html", :trace_name => trace_name, :trace_description => trace_description, :tags => tags %> <dd><%= link_to(@trace_name, @trace_url) %>
<% else %> <% else %>
<%= t ".description_with_no_tags_html", :trace_name => trace_name, :trace_description => trace_description %> <dd><%= @trace_name %>
<% end %> <% end %>
<dt><%= t ".description" %>
<dd><%= @trace_description %>
<% if @trace_tags.length > 0 %>
<dt><%= t ".tags" %>
<dd><%= @trace_tags.map(&:tag).join(", ") %>
<% end %>
</dl>

View file

@ -1,8 +1,14 @@
<% trace_name = @trace_name %> <%= t ".details" %>
<% trace_description = @trace_description %>
<% if @trace_tags.length > 0 %> <%= t ".filename" %>
<% tags = @trace_tags.map { |trace_tag| trace_tag.tag }.join(", ") %> <%= @trace_name %>
<%= t ".description_with_tags", :trace_name => trace_name, :trace_description => trace_description, :tags => tags %> <% if @trace_url %>
<% else %> <%= t ".url" %>
<%= t ".description_with_no_tags", :trace_name => trace_name, :trace_description => trace_description %> <%= @trace_url %>
<% end %>
<%= t ".description" %>
<%= @trace_description %>
<% if @trace_tags.length > 0 %>
<%= t ".tags" %>
<%= @trace_tags.map(&:tag).join(", ") %>
<% end %> <% end %>

View file

@ -1,9 +1,10 @@
<p><%= t ".hi", :to_user => @to_user %></p> <p><%= t ".hi", :to_user => @to_user %></p>
<p> <p><%= t ".failed_to_import" %>
<%= render :partial => "gpx_description" %>
<%= t ".failed_to_import" %> <%= render :partial => "gpx_description" %>
</p>
<p><%= t ".verify" %></p>
<blockquote> <blockquote>
<%= @error %> <%= @error %>

View file

@ -1,8 +1,11 @@
<%= t ".hi", :to_user => @to_user %> <%= t ".hi", :to_user => @to_user %>
<%= render :partial => "gpx_description" %>
<%= t ".failed_to_import" %> <%= t ".failed_to_import" %>
<%= render :partial => "gpx_description" %>
<%= t ".verify" %>
== ==
<%= @error %> <%= @error %>
== ==

View file

@ -1,9 +1,8 @@
<p><%= t ".hi", :to_user => @to_user %></p> <p><%= t ".hi", :to_user => @to_user %></p>
<p> <p><%= t ".loaded_successfully", :trace_points => @trace_points, :count => @possible_points %>
<%= render :partial => "gpx_description" %>
<%= t(".loaded", :trace_points => @trace_points, :count => @possible_points) %> <%= render :partial => "gpx_description" %>
</p>
<p> <p>
<%= t ".all_your_traces_html", :url => link_to(@my_traces_url, @my_traces_url) %> <%= t ".all_your_traces_html", :url => link_to(@my_traces_url, @my_traces_url) %>

View file

@ -1,8 +1,7 @@
<%= t ".hi", :to_user => @to_user %> <%= t ".hi", :to_user => @to_user %>
<%= render :partial => "gpx_description" %> <%= t ".loaded_successfully", :trace_points => @trace_points, :count => @possible_points %>
<%= t(".loaded", :trace_points => @trace_points, :count => @possible_points) %>
<%= t ".trace_location", :trace_url => @trace_url %> <%= render :partial => "gpx_description" %>
<%= t ".all_your_traces", :url => @my_traces_url %> <%= t ".all_your_traces", :url => @my_traces_url %>

View file

@ -1669,23 +1669,24 @@ en:
befriend_them: "You can also add them as a friend at %{befriendurl}." befriend_them: "You can also add them as a friend at %{befriendurl}."
befriend_them_html: "You can also add them as a friend at %{befriendurl}." befriend_them_html: "You can also add them as a friend at %{befriendurl}."
gpx_description: gpx_description:
description_with_tags: "It looks like your file %{trace_name} with the description %{trace_description} and the following tags: %{tags}" details: "Your file details:"
description_with_tags_html: "It looks like your file %{trace_name} with the description %{trace_description} and the following tags: %{tags}" filename: Filename
description_with_no_tags: "It looks like your file %{trace_name} with the description %{trace_description} and no tags" url: URL
description_with_no_tags_html: "It looks like your file %{trace_name} with the description %{trace_description} and no tags" description: Description
tags: Tags
gpx_failure: gpx_failure:
hi: "Hi %{to_user}," hi: "Hi %{to_user},"
failed_to_import: "failed to be imported as a GPS trace file. Please verify that your file is a valid GPX file or an archive containing GPX file(s) in the supported format (.tar.gz, .tar.bz2, .tar, .zip, .gpx.gz, .gpx.bz2). Could there be a format or syntax issue with your file? Here is the importing error:" failed_to_import: "It looks like your file failed to be imported as a GPS trace."
more_info: "More information about GPX import failures and how to avoid them can be found at %{url}." verify: "Please verify that your file is a valid GPX file or an archive containing GPX file(s) in the supported format (.tar.gz, .tar.bz2, .tar, .zip, .gpx.gz, .gpx.bz2). Could there be a format or syntax issue with your file? Here is the importing error:"
more_info: "More information about GPX import failures and how to avoid them can be found at %{url}"
more_info_html: "More information about GPX import failures and how to avoid them can be found at %{url}." more_info_html: "More information about GPX import failures and how to avoid them can be found at %{url}."
import_failures_url: "https://wiki.openstreetmap.org/wiki/GPX_Import_Failures" import_failures_url: "https://wiki.openstreetmap.org/wiki/GPX_Import_Failures"
subject: "[OpenStreetMap] GPX Import failure" subject: "[OpenStreetMap] GPX Import failure"
gpx_success: gpx_success:
hi: "Hi %{to_user}," hi: "Hi %{to_user},"
loaded: loaded_successfully:
one: "loaded successfully with %{trace_points} out of a possible %{count} point." one: "It looks like your file loaded successfully with %{trace_points} out of a possible %{count} point."
other: "loaded successfully with %{trace_points} out of a possible %{count} points." other: "It looks like your file loaded successfully with %{trace_points} out of a possible %{count} points."
trace_location: "Your trace is available at %{trace_url}"
all_your_traces: "All your successfully uploaded GPX traces can be found at %{url}" all_your_traces: "All your successfully uploaded GPX traces can be found at %{url}"
all_your_traces_html: "All your successfully uploaded GPX traces can be found at %{url}." all_your_traces_html: "All your successfully uploaded GPX traces can be found at %{url}."
subject: "[OpenStreetMap] GPX Import success" subject: "[OpenStreetMap] GPX Import success"

View file

@ -15,7 +15,7 @@ class UserMailerTest < ActionMailer::TestCase
end end
email = UserMailer.gpx_success(trace, 100) email = UserMailer.gpx_success(trace, 100)
assert_match("<em>one</em>, <em>two&amp;three</em>, <em>four&lt;five</em>", email.html_part.body.to_s) assert_match("one, two&amp;three, four&lt;five", email.html_part.body.to_s)
assert_match("one, two&three, four<five", email.text_part.body.to_s) assert_match("one, two&three, four<five", email.text_part.body.to_s)
end end