]> git.openstreetmap.org Git - rails.git/commitdiff
Avoid lego translations for coordinates
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 19 Aug 2020 14:43:16 +0000 (16:43 +0200)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 19 Aug 2020 14:43:16 +0000 (16:43 +0200)
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
app/views/browse/note.html.erb
app/views/diary_entries/_location.html.erb
app/views/traces/show.html.erb
config/locales/en.yml

index 683cf6d70ed46c9cf253a395a00ce0abd66f24df..351ec4c6a1edb73c43fd2c87167f5bab72b5afa0 100644 (file)
 <% if @type == "node" and common_details.visible? %>
 <div class="details geo">
   <%= 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}")) %>
 </div>
 <% end %>
 
index 1be7d904170cc1f09edb124345892ff520cc9c7d..ab0344e35aed848247f04b7651ec40e1eec672ac 100644 (file)
       <% end %>
       <li>
         <%= 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}")) %>
       </li>
     </ul>
   </div>
index e85be917a27bb2541d03c54f167ee7440616323e..d5860f11d8e4db5e549b331d0dd3be2ca52754d2 100644 (file)
@@ -1,7 +1,7 @@
 <%= t ".location" %>
 
 <a href="<%= url_for :controller => "site", :action => "index", :anchor => "map=14/#{location.latitude}/#{location.longitude}" %>">
-<abbr class="geo" title="<%= number_with_precision(location.latitude, :precision => 4) %>; <%= number_with_precision(location.longitude, :precision => 4) %>">
+<abbr class="geo" title="<%= t ".coordinates", :latitude => 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 %>
 </abbr>
 </a>
index d82c51881b6d645f8760ceac521a289477c27a8b..6df31760ab6e522dd2049db547e6925a57c36b58 100644 (file)
     <td><%= number_with_delimiter(@trace.size) %></td></tr>
   <tr>
     <td><%= t ".start_coordinates" %></td>
-    <td><div class="d-inline"><span class="latitude"><%= @trace.latitude %></span>; <span class="longitude"><%= @trace.longitude %></span></div> (<%= 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}" %>)</td>
+    <td>
+      <div class="d-inline">
+        <%= t ".coordinates_html",
+              :latitude => tag.span(number_with_delimiter(@trace.latitude), :class => "latitude"),
+              :longitude => tag.span(number_with_delimiter(@trace.longitude), :class => "longitude") %>
+      </div>
+      (<%= 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}" %>)</td>
   </tr>
   <% end %>
   <tr>
index f416f3259dd4e4a54feb299a171c288b2499eff7..44fd977b5fdb31a536e8f5464aeb39b1c4f0db9a 100644 (file)
@@ -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 <abbr title='%{exact_time}'>%{when}</abbr>"
       hidden_by: "Hidden by %{user} <abbr title='%{exact_time}'>%{when}</abbr>"
       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:"