]> git.openstreetmap.org Git - rails.git/commitdiff
Avoid using raw html in translations on the about page
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 22 Mar 2023 16:09:46 +0000 (16:09 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 29 Mar 2023 17:52:45 +0000 (18:52 +0100)
app/views/site/about.html.erb
config/locales/en.yml

index 12d9a06080e4108f1fb8ed5a4061eb6eb53e1bfb..277fb13843da112544d88230d3121ccdbdcd90f6 100644 (file)
@@ -4,7 +4,10 @@
       <div class='row'>
         <div class='col-sm-7 user-image'></div>
         <div class='col-sm-5 px-5 py-3 byosm'>
-          <p class='h5 text-white text-nowrap'><%= t ".copyright_html" %></p>
+          <p class='h5 text-white text-nowrap'>
+            <%= t ".heading_html", :copyright => tag.span(t(".copyright_symbol_html")),
+                                   :br => tag.br %>
+          </p>
         </div>
       </div>
       <div class='row'>
       <% end %>
 
       <%= render :layout => "about_section", :locals => { :icon => "community", :title => "community_driven" } do %>
-        <p><%= t "site.about.community_driven_html", :diary_path => diary_entries_path %></p>
+        <p>
+          <%= t "site.about.community_driven_1_html", :osm_blog_link => link_to(t("site.about.community_driven_osm_blog"),
+                                                                                t("site.about.community_driven_osm_blog_url")),
+                                                      :user_diaries_link => link_to(t("site.about.community_driven_user_diaries"),
+                                                                                    diary_entries_path),
+                                                      :community_blogs_link => link_to(t("site.about.community_driven_community_blogs"),
+                                                                                       t("site.about.community_driven_community_blogs_url")),
+                                                      :osm_foundation_link => link_to(t("site.about.community_driven_osm_foundation"),
+                                                                                      t("site.about.community_driven_osm_foundation_url")) %>
+        </p>
       <% end %>
 
       <%= render :layout => "about_section", :locals => { :id => "open-data", :icon => "open", :title => "open_data" } do %>
-        <p><%= t "site.about.open_data_html", :copyright_path => copyright_path %></p>
+        <p>
+          <%= t "site.about.open_data_1_html", :open_data => tag.i(t("site.about.open_data_open_data")),
+                                               :copyright_license_link => link_to(t("site.about.open_data_copyright_license"),
+                                                                                  copyright_path) %></p>
       <% end %>
 
       <%= render :layout => "about_section", :locals => { :id => "legal", :icon => "legal", :title => "legal" } do %>
-        <p><%= t "site.about.legal_1_html" %></p>
-        <p><%= t "site.about.legal_2_html" %></p>
+        <p>
+          <%= t "site.about.legal_1_1_html", :openstreetmap_foundation_link => link_to(t("site.about.legal_1_1_openstreetmap_foundation"),
+                                                                                       t("site.about.legal_1_1_openstreetmap_foundation_url")),
+                                             :terms_of_use_link => link_to(t("site.about.legal_1_1_terms_of_use"),
+                                                                           t("site.about.legal_1_1_terms_of_use_url")),
+                                             :aup_link => link_to(t("site.about.legal_1_1_aup"),
+                                                                  t("site.about.legal_1_1_aup_url")),
+                                             :privacy_policy_link => link_to(t("site.about.legal_1_1_privacy_policy"),
+                                                                             t("site.about.legal_1_1_privacy_policy_url")) %>
+        </p>
+        <p>
+          <%= t "site.about.legal_2_1_html", :contact_the_osmf_link => link_to(t("site.about.legal_2_1_contact_the_osmf"),
+                                                                               t("site.about.legal_2_1_contact_the_osmf_url")) %>
+        </p>
+        <p>
+          <%= t "site.about.legal_2_2_html", :registered_trademarks_link => link_to(t("site.about.legal_2_2_registered_trademarks"),
+                                                                                    t("site.about.legal_2_2_registered_trademarks_url")) %>
+        </p>
       <% end %>
 
       <%= render :layout => "about_section", :locals => { :id => "partners", :icon => "partners", :title => "partners" } do %>
index ee97ebca2f6911b2fbb1eaa45e49eb1697ad8bac..ed58ef3f110d6cc324d770f8a47d2ca4501bb397 100644 (file)
@@ -1825,7 +1825,8 @@ en:
   site:
     about:
       next: Next
-      copyright_html: <span>&copy;</span>OpenStreetMap<br>contributors
+      heading_html: "%{copyright}OpenStreetMap %{br} contributors"
+      copyright_symbol_html: "&copy;"
       used_by_html: "%{name} provides map data for thousands of websites, mobile apps, and hardware devices"
       lede_text: |
         OpenStreetMap is built by a community of mappers that contribute and maintain data
@@ -1836,35 +1837,52 @@ en:
         aerial imagery, GPS devices, and low-tech field maps to verify that OSM
         is accurate and up to date.
       community_driven_title: Community Driven
-      community_driven_html: |
+      community_driven_1_html: |
         OpenStreetMap's community is diverse, passionate, and growing every day.
         Our contributors include enthusiast mappers, GIS professionals, engineers
         running the OSM servers, humanitarians mapping disaster-affected areas,
         and many more.
-        To learn more about the community, see the
-        <a href='https://blog.openstreetmap.org'>OpenStreetMap Blog</a>,
-        <a href='%{diary_path}'>user diaries</a>,
-        <a href='https://blogs.openstreetmap.org/'>community blogs</a>, and
-        the <a href='https://www.osmfoundation.org/'>OSM Foundation</a> website.
+        To learn more about the community, see the %{osm_blog_link},
+        %{user_diaries_link}, %{community_blogs_link}, and the
+        %{osm_foundation_link} website.
+      community_driven_osm_blog: OpenStreetMap Blog
+      community_driven_osm_blog_url: https://blog.openstreetmap.org
+      community_driven_user_diaries: user diaries
+      community_driven_community_blogs: community blogs
+      community_driven_community_blogs_url: https://blogs.openstreetmap.org/
+      community_driven_osm_foundation: OSM Foundation
+      community_driven_osm_foundation_url: https://www.osmfoundation.org/
       open_data_title: Open Data
-      open_data_html: |
-        OpenStreetMap is <i>open data</i>: you are free to use it for any purpose
+      open_data_1_html: |
+        OpenStreetMap is %{open_data}: you are free to use it for any purpose
         as long as you credit OpenStreetMap and its contributors. If you alter or
         build upon the data in certain ways, you may distribute the result only
-        under the same licence. See the <a href='%{copyright_path}'>Copyright and
-        License page</a> for details.
+        under the same licence. See the %{copyright_license_link} for details.
+      open_data_open_data: open data
+      open_data_copyright_license: Copyright and License page
       legal_title: Legal
-      legal_1_html: |
+      legal_1_1_html: |
         This site and many other related services are formally operated by the
-        <a href='https://osmfoundation.org/'>OpenStreetMap Foundation</a> (OSMF)
+        %{openstreetmap_foundation_link} (OSMF)
         on behalf of the community. Use of all OSMF operated services is subject
-        to our <a href="https://wiki.osmfoundation.org/wiki/Terms_of_Use">Terms of Use</a>, <a href="https://wiki.openstreetmap.org/wiki/Acceptable_Use_Policy">
-        Acceptable Use Policies</a> and our <a href="https://wiki.osmfoundation.org/wiki/Privacy_Policy">Privacy Policy</a>.
-      legal_2_html: |
-        Please <a href='https://osmfoundation.org/Contact'>contact the OSMF</a>
+        to our %{terms_of_use_link}, %{aup_link} and our %{privacy_policy_link}.
+      legal_1_1_openstreetmap_foundation: OpenStreetMap Foundation
+      legal_1_1_openstreetmap_foundation_url: https://osmfoundation.org/
+      legal_1_1_terms_of_use: Terms of Use
+      legal_1_1_terms_of_use_url: https://wiki.osmfoundation.org/wiki/Terms_of_Use
+      legal_1_1_aup: Acceptable Use Policies
+      legal_1_1_aup_url: https://wiki.openstreetmap.org/wiki/Acceptable_Use_Policy
+      legal_1_1_privacy_policy: Privacy Policy
+      legal_1_1_privacy_policy_url: https://wiki.osmfoundation.org/wiki/Privacy_Policy
+      legal_2_1_html: |
+        Please %{contact_the_osmf_link}
         if you have licensing, copyright or other legal questions.
-        <br>
-        OpenStreetMap, the magnifying glass logo and State of the Map are <a href="https://wiki.osmfoundation.org/wiki/Trademark_Policy">registered trademarks of the OSMF</a>.
+      legal_2_1_contact_the_osmf: contact the OSMF
+      legal_2_1_contact_the_osmf_url: https://osmfoundation.org/Contact
+      legal_2_2_html: |
+        OpenStreetMap, the magnifying glass logo and State of the Map are %{registered_trademarks_link}.
+      legal_2_2_registered_trademarks: registered trademarks of the OSMF
+      legal_2_2_registered_trademarks_url: https://wiki.osmfoundation.org/wiki/Trademark_Policy
       partners_title: Partners
     copyright:
       foreign: