]> git.openstreetmap.org Git - rails.git/commitdiff
Rework geocoder titles to avoid raw html in translations
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 29 Mar 2023 15:43:58 +0000 (16:43 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Sun, 2 Apr 2023 09:14:00 +0000 (10:14 +0100)
app/views/geocoder/search.html.erb
config/locales/en.yml

index ceb099421a1ee2ef6e1cbf878b489a6669411b41..86048b0ad8b272fa5efef49c5b934ed70f0b4de0 100644 (file)
@@ -3,7 +3,10 @@
 <%= render "sidebar_header", :title => t("site.sidebar.search_results") %>
 
 <% @sources.each do |source| %>
-  <h4><%= t(".title.#{source}_html") %></h4>
+  <h4>
+    <%= t(".title.results_from_html", :results_link => link_to(t(".title.#{source}"),
+                                                               t(".title.#{source}_url"))) %>
+  </h4>
   <div class="search_results_entry mx-n3" data-href="<%= url_for @params.merge(:action => "search_#{source}") %>">
     <div class="text-center loader">
       <div class="spinner-border" role="status">
index d64c1178278b300616a94198e66a1a55df56d154..afc578b6940a3bc74fc20637cb4a586901f662db 100644 (file)
@@ -590,9 +590,13 @@ en:
   geocoder:
     search:
       title:
-        latlon_html: 'Results from <a href="https://openstreetmap.org/">Internal</a>'
-        osm_nominatim_html: 'Results from <a href="https://nominatim.openstreetmap.org/">OpenStreetMap Nominatim</a>'
-        osm_nominatim_reverse_html: 'Results from <a href="https://nominatim.openstreetmap.org/">OpenStreetMap Nominatim</a>'
+        results_from_html: 'Results from %{results_link}'
+        latlon: Internal
+        latlon_url: https://openstreetmap.org/
+        osm_nominatim: OpenStreetMap Nominatim
+        osm_nominatim_url: https://nominatim.openstreetmap.org/
+        osm_nominatim_reverse: OpenStreetMap Nominatim
+        osm_nominatim_reverse_url: https://nominatim.openstreetmap.org/
     search_osm_nominatim:
       prefix_format: "%{name}"
       prefix: