From 613b748c5556139bdd04b6cda2f5ebf448e20aa2 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 19 Aug 2020 16:43:16 +0200 Subject: [PATCH] Avoid lego translations for coordinates Use the i18n system for joining coordinate values together, while avoiding making any changes or standardisation involving the exact symbol used in each situation. Refs #2732 --- app/views/browse/_common_details.html.erb | 5 ++++- app/views/browse/note.html.erb | 5 ++++- app/views/diary_entries/_location.html.erb | 2 +- app/views/traces/show.html.erb | 8 +++++++- config/locales/en.yml | 5 +++++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/views/browse/_common_details.html.erb b/app/views/browse/_common_details.html.erb index 683cf6d70..351ec4c6a 100644 --- a/app/views/browse/_common_details.html.erb +++ b/app/views/browse/_common_details.html.erb @@ -24,7 +24,10 @@ <% if @type == "node" and common_details.visible? %>
<%= t "browse.location" %> - <%= link_to(tag.span(number_with_delimiter(common_details.lat), :class => "latitude") + ", " + tag.span(number_with_delimiter(common_details.lon), :class => "longitude"), root_path(:anchor => "map=18/#{common_details.lat}/#{common_details.lon}")) %> + <%= link_to(t(".coordinates_html", + :latitude => tag.span(number_with_delimiter(common_details.lat), :class => "latitude"), + :longitude => tag.span(number_with_delimiter(common_details.lon), :class => "longitude")), + root_path(:anchor => "map=18/#{common_details.lat}/#{common_details.lon}")) %>
<% end %> diff --git a/app/views/browse/note.html.erb b/app/views/browse/note.html.erb index 1be7d9041..ab0344e35 100644 --- a/app/views/browse/note.html.erb +++ b/app/views/browse/note.html.erb @@ -19,7 +19,10 @@ <% end %>
  • <%= t "browse.location" %> - <%= link_to(tag.span(number_with_delimiter(@note.lat), :class => "latitude") + ", " + tag.span(number_with_delimiter(@note.lon), :class => "longitude"), root_path(:anchor => "map=18/#{@note.lat}/#{@note.lon}")) %> + <%= link_to(t(".coordinates_html", + :latitude => tag.span(number_with_delimiter(@note.lat), :class => "latitude"), + :longitude => tag.span(number_with_delimiter(@note.lon), :class => "longitude")), + root_path(:anchor => "map=18/#{@note.lat}/#{@note.lon}")) %>
  • diff --git a/app/views/diary_entries/_location.html.erb b/app/views/diary_entries/_location.html.erb index e85be917a..d5860f11d 100644 --- a/app/views/diary_entries/_location.html.erb +++ b/app/views/diary_entries/_location.html.erb @@ -1,7 +1,7 @@ <%= t ".location" %> "index", :anchor => "map=14/#{location.latitude}/#{location.longitude}" %>"> - + number_with_precision(location.latitude, :precision => 4), :longitude => number_with_precision(location.longitude, :precision => 4) %>"> <%= describe_location location.latitude, location.longitude, 14, location.language_code %> diff --git a/app/views/traces/show.html.erb b/app/views/traces/show.html.erb index d82c51881..6df31760a 100644 --- a/app/views/traces/show.html.erb +++ b/app/views/traces/show.html.erb @@ -25,7 +25,13 @@ <%= number_with_delimiter(@trace.size) %> <%= t ".start_coordinates" %> -
    <%= @trace.latitude %>; <%= @trace.longitude %>
    (<%= link_to t(".map"), :controller => "site", :action => "index", :mlat => @trace.latitude, :mlon => @trace.longitude, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %> / <%= link_to t(".edit"), :controller => "site", :action => "edit", :gpx => @trace.id, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %>) + +
    + <%= t ".coordinates_html", + :latitude => tag.span(number_with_delimiter(@trace.latitude), :class => "latitude"), + :longitude => tag.span(number_with_delimiter(@trace.longitude), :class => "longitude") %> +
    + (<%= link_to t(".map"), :controller => "site", :action => "index", :mlat => @trace.latitude, :mlon => @trace.longitude, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %> / <%= link_to t(".edit"), :controller => "site", :action => "edit", :gpx => @trace.id, :anchor => "map=14/#{@trace.latitude}/#{@trace.longitude}" %>) <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index f416f3259..44fd977b5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -220,6 +220,8 @@ en: view_history: "View History" view_details: "View Details" location: "Location:" + common_details: + coordinates_html: "%{latitude}, %{longitude}" changeset: title: "Changeset: %{id}" belongs_to: "Author" @@ -318,6 +320,7 @@ en: reopened_by_anonymous: "Reactivated by anonymous %{when}" hidden_by: "Hidden by %{user} %{when}" report: Report this note + coordinates_html: "%{latitude}, %{longitude}" query: title: "Query Features" introduction: "Click on the map to find nearby features." @@ -423,6 +426,7 @@ en: location: "Location:" view: "View" edit: "Edit" + coordinates: "%{latitude}; %{longitude}" feed: user: title: "OpenStreetMap diary entries for %{user}" @@ -2043,6 +2047,7 @@ en: uploaded: "Uploaded:" points: "Points:" start_coordinates: "Start coordinate:" + coordinates_html: "%{latitude}; %{longitude}" map: "map" edit: "edit" owner: "Owner:" -- 2.39.5