]> git.openstreetmap.org Git - rails.git/commitdiff
Avoid using raw html in translations on the copyright page
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 15 Mar 2023 14:12:56 +0000 (14:12 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 22 Mar 2023 14:40:55 +0000 (14:40 +0000)
app/views/site/copyright.html.erb
config/locales/en.yml

index e94fad402b0df97309ba96a733a0b7770d6388c6..100b485aa5d1ae38d75088450600e310e7fa2026 100644 (file)
 
 <% I18n.with_locale @locale do %>
   <%= tag.div :lang => @locale, :dir => t("html.dir") do %>
-    <p><%= t ".legal_babble.intro_1_html" %></p>
-    <p><%= t ".legal_babble.intro_2_html" %></p>
-    <p><%= t ".legal_babble.intro_3_1_html" %></p>
+    <p>
+      <%= t ".legal_babble.introduction_1_html",
+            :registered_trademark_link => tag.sup(link_to(t(".legal_babble.introduction_1_registered_trademark_html"),
+                                                          :anchor => "trademarks")),
+            :open_data => tag.i(t(".legal_babble.introduction_1_open_data")),
+            :odc_odbl_link => link_to(t(".legal_babble.introduction_1_odc_odbl"),
+                                      t(".legal_babble.introduction_1_odc_odbl_url")),
+            :osm_foundation_link => link_to(t(".legal_babble.introduction_1_osm_foundation"),
+                                            t(".legal_babble.introduction_1_osm_foundation_url")) %>
+    </p>
+    <p>
+      <%= t ".legal_babble.introduction_2_html",
+            :legal_code_link => link_to(t(".legal_babble.introduction_2_legal_code"),
+                                        t(".legal_babble.introduction_2_legal_code_url")) %>
+    </p>
+    <p>
+      <%= t ".legal_babble.introduction_3_html",
+            :creative_commons_link => link_to(t(".legal_babble.introduction_3_creative_commons"),
+                                              t(".legal_babble.introduction_3_creative_commons_url")) %>
+    </p>
 
     <h3><%= t ".legal_babble.credit_title_html" %></h3>
     <p><%= t ".legal_babble.credit_1_html" %></p>
-    <p><%= t ".legal_babble.credit_2_1_html" %></p>
-    <p><%= t ".legal_babble.credit_3_1_html" %></p>
-    <p><%= t ".legal_babble.credit_4_html" %></p>
+    <ul>
+      <li><%= t ".legal_babble.credit_2_1" %></li>
+      <li><%= t ".legal_babble.credit_2_2" %></li>
+    </ul>
+    <p>
+      <%= t ".legal_babble.credit_3_html",
+            :attribution_guidelines_link => link_to(t(".legal_babble.credit_3_attribution_guidelines"),
+                                                    t(".legal_babble.credit_3_attribution_guidelines_url")) %>
+    </p>
+    <p>
+      <%= t ".legal_babble.credit_4_1_html",
+            :this_copyright_page_link => link_to(t(".legal_babble.credit_4_1_this_copyright_page"),
+                                                 copyright_path) %>
+    </p>
     <p><%= image_tag("attribution_example.png",
                      :alt => t(".legal_babble.attribution_example.alt"),
                      :border => 0,
                      :title => t(".legal_babble.attribution_example.title")) %></p>
 
     <h3><%= t ".legal_babble.more_title_html" %></h3>
-    <p><%= t ".legal_babble.more_1_html" %></p>
-    <p><%= t ".legal_babble.more_2_html" %></p>
+    <p>
+      <%= t ".legal_babble.more_1_1_html",
+            :osmf_licence_page_link => link_to(t(".legal_babble.more_1_1_osmf_licence_page"),
+                                               t(".legal_babble.more_1_1_osmf_licence_page_url")) %>
+    </p>
+    <p>
+      <%= t ".legal_babble.more_2_1_html",
+            :api_usage_policy_link => link_to(t(".legal_babble.more_2_1_api_usage_policy"),
+                                              t(".legal_babble.more_2_1_api_usage_policy_url")),
+            :tile_usage_policy_link => link_to(t(".legal_babble.more_2_1_tile_usage_policy"),
+                                               t(".legal_babble.more_2_1_tile_usage_policy_url")),
+            :nominatim_usage_policy_link => link_to(t(".legal_babble.more_2_1_nominatim_usage_policy"),
+                                                    t(".legal_babble.more_2_1_nominatim_usage_policy_url")) %>
+    </p>
 
     <h3><%= t ".legal_babble.contributors_title_html" %></h3>
     <p><%= t ".legal_babble.contributors_intro_html" %></p>
       <li><%= t ".legal_babble.contributors_za_html" %></li>
       <li><%= t ".legal_babble.contributors_gb_html" %></li>
     </ul>
-    <p><%= t ".legal_babble.contributors_footer_1_html" %></p>
+    <p>
+      <%= t ".legal_babble.contributors_2_html",
+            :contributors_page_link => link_to(t(".legal_babble.contributors_2_contributors_page"),
+                                               t(".legal_babble.contributors_2_contributors_page_url")) %>
+    </p>
     <p><%= t ".legal_babble.contributors_footer_2_html" %></p>
 
     <h3><%= t ".legal_babble.infringement_title_html" %></h3>
     <p><%= t ".legal_babble.infringement_1_html" %></p>
-    <p><%= t ".legal_babble.infringement_2_html" %></p>
+    <p>
+      <%= t ".legal_babble.infringement_2_1_html",
+            :takedown_procedure_link => link_to(t(".legal_babble.infringement_2_1_takedown_procedure"),
+                                                t(".legal_babble.infringement_2_1_takedown_procedure_url")),
+            :online_filing_page_link => link_to(t(".legal_babble.infringement_2_1_online_filing_page"),
+                                                t(".legal_babble.infringement_2_1_online_filing_page_url")) %>
+    </p>
 
-    <h3><%= t ".legal_babble.trademarks_title_html" %></h3>
-    <p><%= t ".legal_babble.trademarks_1_html" %></p>
+    <h3 id="trademarks">
+      <%= t ".legal_babble.trademarks_title" %>
+    </h3>
+    <p>
+      <%= t ".legal_babble.trademarks_1_1_html",
+            :trademark_policy_link => link_to(t(".legal_babble.trademarks_1_1_trademark_policy"),
+                                              t(".legal_babble.trademarks_1_1_trademark_policy_url")) %>
+    </p>
   <% end %>
 <% end %>
index 302cebd351872b5dd167254f64762784228d2cba..d2dcba8e7923763be6de5e5b9233451fd6ee5ce1 100644 (file)
@@ -1878,61 +1878,67 @@ en:
         mapping_link: start mapping
       legal_babble:
         title_html: Copyright and License
-        intro_1_html: |
-          OpenStreetMap<sup><a href="#trademarks">&reg;</a></sup> is <i>open data</i>, licensed under the <a
-          href="https://opendatacommons.org/licenses/odbl/">Open Data
-          Commons Open Database License</a> (ODbL) by the  <a
-          href="https://osmfoundation.org/">OpenStreetMap Foundation</a> (OSMF).
-        intro_2_html: |
+        introduction_1_html: |
+          OpenStreetMap%{registered_trademark_link} is %{open_data}, licensed under the
+          %{odc_odbl_link} (ODbL) by the %{osm_foundation_link} (OSMF).
+        introduction_1_registered_trademark_html: "&reg;"
+        introduction_1_open_data: open data
+        introduction_1_odc_odbl: Open Data Commons Open Database License
+        introduction_1_odc_odbl_url: https://opendatacommons.org/licenses/odbl/
+        introduction_1_osm_foundation: OpenStreetMap Foundation
+        introduction_1_osm_foundation_url: https://osmfoundation.org/
+        introduction_2_html: |
           You are free to copy, distribute, transmit and adapt our data,
           as long as you credit OpenStreetMap and its
           contributors. If you alter or build upon our data, you
           may distribute the result only under the same licence. The
-          full <a href="https://opendatacommons.org/licenses/odbl/1.0/">legal
-          code</a> explains your rights and responsibilities.
-        intro_3_1_html: |
-          Our documentation is licensed under the
-          <a href="https://creativecommons.org/licenses/by-sa/2.0/">Creative
-          Commons Attribution-ShareAlike 2.0</a> license (CC BY-SA 2.0).
+          full %{legal_code_link} explains your rights and responsibilities.
+        introduction_2_legal_code: legal code
+        introduction_2_legal_code_url: https://opendatacommons.org/licenses/odbl/1.0/
+        introduction_3_html: |
+          Our documentation is licensed under the %{creative_commons_link} license (CC BY-SA 2.0).
+        introduction_3_creative_commons: Creative Commons Attribution-ShareAlike 2.0
+        introduction_3_creative_commons_url: https://creativecommons.org/licenses/by-sa/2.0/
         credit_title_html: How to credit OpenStreetMap
         credit_1_html: |
           Where you use OpenStreetMap data, you are required to do the following two things:
-        credit_2_1_html: |
-          <ul>
-            <li>Provide credit to OpenStreetMap by displaying our copyright notice.</li>
-            <li>Make clear that the data is available under the Open Database License.</li>
-          </ul>
-        credit_3_1_html: |
+        credit_2_1: Provide credit to OpenStreetMap by displaying our copyright notice.
+        credit_2_2: Make clear that the data is available under the Open Database License.
+        credit_3_html: |
          For the copyright notice, we have different requirements on how this should be
          displayed, depending on how you are using our data. For example, different
          rules apply on how to show the copyright notice depending on whether you have
          created a browsable map, a printed map or a static image. Full details on the
-         requirements can be found in the
-         <a href="https://wiki.osmfoundation.org/wiki/Licence/Attribution_Guidelines">Attribution
-         Guidelines</a>.
-        credit_4_html: |
+         requirements can be found in the %{attribution_guidelines_link}.
+        credit_3_attribution_guidelines: Attribution Guidelines
+        credit_3_attribution_guidelines_url: https://wiki.osmfoundation.org/wiki/Licence/Attribution_Guidelines
+        credit_4_1_html: |
           To make clear that the data is available under the Open
-          Database License, you may link to
-          <a href="https://www.openstreetmap.org/copyright">this copyright page</a>.
+          Database License, you may link to %{this_copyright_page_link}.
           Alternatively, and as a requirement if you are distributing OSM in a
           data form, you can name and link directly to the license(s). In media
           where links are not possible (e.g. printed works), we suggest you
           direct your readers to openstreetmap.org (perhaps by expanding
           'OpenStreetMap' to this full address) and to opendatacommons.org.
           In this example, the credit appears in the corner of the map.
+        credit_4_1_this_copyright_page: this copyright page
         attribution_example:
           alt: Example of how to attribute OpenStreetMap on a webpage
           title: Attribution example
         more_title_html: Finding out more
-        more_1_html: |
-          Read more about using our data, and how to credit us, at the <a
-          href="https://osmfoundation.org/Licence">OSMF Licence page</a>.
-        more_2_html: |
+        more_1_1_html: Read more about using our data, and how to credit us, at the %{osmf_licence_page_link}.
+        more_1_1_osmf_licence_page: OSMF Licence page
+        more_1_1_osmf_licence_page_url: https://osmfoundation.org/Licence
+        more_2_1_html: |
           Although OpenStreetMap is open data, we cannot provide a
           free-of-charge map API for third-parties.
-          See our <a href="https://operations.osmfoundation.org/policies/api/">API Usage Policy</a>,
-          <a href="https://operations.osmfoundation.org/policies/tiles/">Tile Usage Policy</a>
-          and <a href="https://operations.osmfoundation.org/policies/nominatim/">Nominatim Usage Policy</a>.
+          See our %{api_usage_policy_link}, %{tile_usage_policy_link} and %{nominatim_usage_policy_link}.
+        more_2_1_api_usage_policy: API Usage Policy
+        more_2_1_api_usage_policy_url: https://operations.osmfoundation.org/policies/api/
+        more_2_1_tile_usage_policy: Tile Usage Policy
+        more_2_1_tile_usage_policy_url: https://operations.osmfoundation.org/policies/tiles/
+        more_2_1_nominatim_usage_policy: Nominatim Usage Policy
+        more_2_1_nominatim_usage_policy_url: https://operations.osmfoundation.org/policies/nominatim/
         contributors_title_html: Our contributors
         contributors_intro_html: |
           Our contributors are thousands of individuals. We also include
@@ -1989,11 +1995,11 @@ en:
           <strong>United Kingdom</strong>: Contains Ordnance
           Survey data &copy; Crown copyright and database right
           2010-2023.
-        contributors_footer_1_html: |
+        contributors_2_html: |
           For further details of these, and other sources that have been used
-          to help improve OpenStreetMap, please see the <a
-          href="https://wiki.openstreetmap.org/wiki/Contributors">Contributors
-          page</a> on the OpenStreetMap Wiki.
+          to help improve OpenStreetMap, please see the %{contributors_page_link} on the OpenStreetMap Wiki.
+        contributors_2_contributors_page: Contributors page
+        contributors_2_contributors_page_url: https://wiki.openstreetmap.org/wiki/Contributors
         contributors_footer_2_html: |
           Inclusion of data in OpenStreetMap does not imply that the original
           data provider endorses OpenStreetMap, provides any warranty, or
@@ -2003,15 +2009,22 @@ en:
           OSM contributors are reminded never to add data from any
           copyrighted sources (e.g. Google Maps or printed maps) without
           explicit permission from the copyright holders.
-        infringement_2_html: |
+        infringement_2_1_html: |
           If you believe that copyrighted material has been inappropriately
           added to the OpenStreetMap database or this site, please refer
-          to our <a href="https://wiki.osmfoundation.org/wiki/Takedown_procedure">takedown
-          procedure</a> or file directly at our
-          <a href="https://dmca.openstreetmap.org/">on-line filing page</a>.
-        trademarks_title_html: <span id="trademarks"></span>Trademarks
-        trademarks_1_html: |
-          OpenStreetMap, the magnifying glass logo and State of the Map are registered trademarks of the OpenStreetMap Foundation. If you have questions about your use of the marks, please see our <a href="https://wiki.osmfoundation.org/wiki/Trademark_Policy">Trademark Policy</a>.
+          to our %{takedown_procedure_link} or file directly at our
+          %{online_filing_page_link}.
+        infringement_2_1_takedown_procedure: takedown procedure
+        infringement_2_1_takedown_procedure_url: https://wiki.osmfoundation.org/wiki/Takedown_procedure
+        infringement_2_1_online_filing_page: on-line filing page
+        infringement_2_1_online_filing_page_url: https://dmca.openstreetmap.org/
+        trademarks_title: Trademarks
+        trademarks_1_1_html: |
+          OpenStreetMap, the magnifying glass logo and State of the Map are registered trademarks of the
+          OpenStreetMap Foundation. If you have questions about your use of the marks, please see our
+          %{trademark_policy_link}.
+        trademarks_1_1_trademark_policy: Trademark Policy
+        trademarks_1_1_trademark_policy_url: https://wiki.osmfoundation.org/wiki/Trademark_Policy
     index:
       js_1: "You are either using a browser that does not support JavaScript, or you have disabled JavaScript."
       js_2: "OpenStreetMap uses JavaScript for its slippy map."