From: Tom Hughes Date: Sun, 2 Apr 2023 17:39:12 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/3999' X-Git-Tag: live~2118 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/3c6453a3917174547e7896d5810550b3a99563ab?hp=c8f6d6df0f2d7ad15de4833e855701b05d1dde5e Merge remote-tracking branch 'upstream/pull/3999' --- diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index 44aa530d9..88d16bc8e 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -15,13 +15,55 @@ L.OSM.Map = L.Map.extend({ initialize: function (id, options) { L.Map.prototype.initialize.call(this, id, options); - var copyright = I18n.t("javascripts.map.copyright", { copyright_url: "/copyright" }); - var donate = I18n.t("javascripts.map.donate_link_text", { donate_url: "https://donate.openstreetmap.org" }); - var terms = I18n.t("javascripts.map.terms", { terms_url: "https://wiki.osmfoundation.org/wiki/Terms_of_Use" }); - var cyclosm = I18n.t("javascripts.map.cyclosm", { cyclosm_url: "https://www.cyclosm.org", osmfrance_url: "https://openstreetmap.fr/" }); - var thunderforest = I18n.t("javascripts.map.thunderforest", { thunderforest_url: "https://www.thunderforest.com/" }); - var memomaps = I18n.t("javascripts.map.opnvkarte", { memomaps_url: "https://memomaps.de/" }); - var hotosm = I18n.t("javascripts.map.hotosm", { hotosm_url: "https://www.hotosm.org/", osmfrance_url: "https://openstreetmap.fr/" }); + var copyright_link = $("", { + href: "/copyright", + text: I18n.t("javascripts.map.openstreetmap_contributors") + }).prop("outerHTML"); + var copyright = I18n.t("javascripts.map.copyright_text", { copyright_link: copyright_link }); + + var donate = $("", { + "href": "https://donate.openstreetmap.org", + "class": "donate-attr", + "text": I18n.t("javascripts.map.make_a_donation") + }).prop("outerHTML"); + + var terms = $("", { + href: "https://wiki.osmfoundation.org/wiki/Terms_of_Use", + text: I18n.t("javascripts.map.website_and_api_terms") + }).prop("outerHTML"); + + var cyclosm_link = $("", { + href: "https://www.cyclosm.org", + target: "_blank", + text: I18n.t("javascripts.map.cyclosm_name") + }).prop("outerHTML"); + var osm_france_link = $("", { + href: "https://openstreetmap.fr/", + target: "_blank", + text: I18n.t("javascripts.map.osm_france") + }).prop("outerHTML"); + var cyclosm = I18n.t("javascripts.map.cyclosm_credit", { cyclosm_link: cyclosm_link, osm_france_link: osm_france_link }); + + var thunderforest_link = $("", { + href: "https://www.thunderforest.com/", + target: "_blank", + text: I18n.t("javascripts.map.andy_allan") + }).prop("outerHTML"); + var thunderforest = I18n.t("javascripts.map.thunderforest_credit", { thunderforest_link: thunderforest_link }); + + var memomaps_link = $("", { + href: "https://memomaps.de/", + target: "_blank", + text: I18n.t("javascripts.map.memomaps") + }).prop("outerHTML"); + var memomaps = I18n.t("javascripts.map.opnvkarte_credit", { memomaps_link: memomaps_link }); + + var hotosm_link = $("", { + href: "https://www.hotosm.org/", + target: "_blank", + text: I18n.t("javascripts.map.hotosm_name") + }).prop("outerHTML"); + var hotosm = I18n.t("javascripts.map.hotosm_credit", { hotosm_link: hotosm_link, osm_france_link: osm_france_link }); this.baseLayers = []; diff --git a/app/helpers/note_helper.rb b/app/helpers/note_helper.rb index 86e5c40f8..42fd089e4 100644 --- a/app/helpers/note_helper.rb +++ b/app/helpers/note_helper.rb @@ -3,13 +3,13 @@ module NoteHelper def note_event(event, at, by) if by.nil? - t("notes.show.#{event}_by_anonymous_html", - :when => friendly_date_ago(at), - :exact_time => l(at)) + t("notes.show.event_#{event}_by_anonymous_html", + :time_ago => tag.abbr(friendly_date_ago(at), + :title => l(at))) else - t("notes.show.#{event}_by_html", - :when => friendly_date_ago(at), - :exact_time => l(at), + t("notes.show.event_#{event}_by_html", + :time_ago => tag.abbr(friendly_date_ago(at), + :title => l(at)), :user => note_author(by)) end end diff --git a/app/views/geocoder/search.html.erb b/app/views/geocoder/search.html.erb index ceb099421..86048b0ad 100644 --- a/app/views/geocoder/search.html.erb +++ b/app/views/geocoder/search.html.erb @@ -3,7 +3,10 @@ <%= render "sidebar_header", :title => t("site.sidebar.search_results") %> <% @sources.each do |source| %> -

<%= t(".title.#{source}_html") %>

+

+ <%= t(".title.results_from_html", :results_link => link_to(t(".title.#{source}"), + t(".title.#{source}_url"))) %> +

">
diff --git a/app/views/site/fixthemap.html.erb b/app/views/site/fixthemap.html.erb index ab8684116..c1a61362f 100644 --- a/app/views/site/fixthemap.html.erb +++ b/app/views/site/fixthemap.html.erb @@ -22,7 +22,7 @@
<%= t "site.welcome.add_a_note.title" %>

<%= t "site.welcome.add_a_note.para_1" %>

-

<%= t ".how_to_help.add_a_note.instructions_html", :map_url => root_path %>

+

<%= t ".how_to_help.add_a_note.instructions_1_html", :note_icon => tag.a(:class => "icon note") %>

diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index f160de913..27e98b45b 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -22,7 +22,11 @@ <%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %> <%= f.email_field :email, :tabindex => 1 %> - <%= f.email_field :email_confirmation, :tabindex => 2 %> + <%= f.email_field :email_confirmation, :help => t(".email_confirmation_help_html", + :privacy_policy_link => link_to(t(".privacy_policy"), + t(".privacy_policy_url"), + :title => t(".privacy_policy_title"))), + :tabindex => 2 %> <%= f.text_field :display_name, :help => t(".display name description"), :tabindex => 3 %> diff --git a/config/locales/en.yml b/config/locales/en.yml index f431ccde7..8e60a9a67 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -154,7 +154,6 @@ en: reason: The reason why the user is being blocked. Please be as calm and as reasonable as possible, giving as much detail as you can about the situation, remembering that the message will be publicly visible. Bear in mind that not all users understand the community jargon, so please try to use layman's terms. needs_view: Does the user need to log in before this block will be cleared? user: - email_confirmation: 'Your address is not displayed publicly, see our
privacy policy for more information.' new_email: "(never displayed publicly)" datetime: distance_in_words_ago: @@ -591,9 +590,13 @@ en: geocoder: search: title: - latlon_html: 'Results from Internal' - osm_nominatim_html: 'Results from OpenStreetMap Nominatim' - osm_nominatim_reverse_html: 'Results from OpenStreetMap Nominatim' + 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: @@ -2141,8 +2144,8 @@ en: If you have noticed a problem with our map data, for example a road is missing or your address, the best way to proceed is to join the OpenStreetMap community and add or repair the data yourself. add_a_note: - instructions_html: | - Just click or the same icon on the map display. + instructions_1_html: | + Just click %{note_icon} or the same icon on the map display. This will add a marker to the map, which you can move by dragging. Add your message, then click save, and other mappers will investigate. other_concerns: @@ -2623,6 +2626,10 @@ en: auth no password: "With third party authentication a password is not required, but some extra tools or server may still need one." continue: Sign Up terms accepted: "Thanks for accepting the new contributor terms!" + email_confirmation_help_html: 'Your address is not displayed publicly, see our %{privacy_policy_link} for more information.' + privacy_policy: privacy policy + privacy_policy_url: https://wiki.osmfoundation.org/wiki/Privacy_Policy + privacy_policy_title: OSMF privacy policy including section on email addresses terms: title: "Terms" heading: "Terms" @@ -2873,15 +2880,15 @@ en: open_title: "Unresolved note #%{note_name}" closed_title: "Resolved note #%{note_name}" hidden_title: "Hidden note #%{note_name}" - opened_by_html: "Created by %{user} %{when}" - opened_by_anonymous_html: "Created by anonymous %{when}" - commented_by_html: "Comment from %{user} %{when}" - commented_by_anonymous_html: "Comment from anonymous %{when}" - closed_by_html: "Resolved by %{user} %{when}" - closed_by_anonymous_html: "Resolved by anonymous %{when}" - reopened_by_html: "Reactivated by %{user} %{when}" - reopened_by_anonymous_html: "Reactivated by anonymous %{when}" - hidden_by_html: "Hidden by %{user} %{when}" + event_opened_by_html: "Created by %{user} %{time_ago}" + event_opened_by_anonymous_html: "Created by anonymous %{time_ago}" + event_commented_by_html: "Comment from %{user} %{time_ago}" + event_commented_by_anonymous_html: "Comment from anonymous %{time_ago}" + event_closed_by_html: "Resolved by %{user} %{time_ago}" + event_closed_by_anonymous_html: "Resolved by anonymous %{time_ago}" + event_reopened_by_html: "Reactivated by %{user} %{time_ago}" + event_reopened_by_anonymous_html: "Reactivated by anonymous %{time_ago}" + event_hidden_by_html: "Hidden by %{user} %{time_ago}" report: report this note coordinates_html: "%{latitude}, %{longitude}" anonymous_warning: This note includes comments from anonymous users which should be independently verified. @@ -2953,13 +2960,19 @@ en: gps: Public GPS Traces overlays: Enable overlays for troubleshooting the map title: "Layers" - copyright: "© OpenStreetMap contributors" - donate_link_text: "" - terms: "Website and API terms" - cyclosm: "Tiles style by CyclOSM hosted by OpenStreetMap France" - thunderforest: "Tiles courtesy of Andy Allan" - opnvkarte: "Tiles courtesy of MeMoMaps" - hotosm: "Tiles style by Humanitarian OpenStreetMap Team hosted by OpenStreetMap France" + copyright_text: "© %{copyright_link}" + openstreetmap_contributors: "OpenStreetMap contributors" + make_a_donation: Make a Donation + website_and_api_terms: Website and API terms + cyclosm_credit: "Tiles style by %{cyclosm_link} hosted by %{osm_france_link}" + cyclosm_name: CyclOSM + osm_france: OpenStreetMap France + thunderforest_credit: "Tiles courtesy of %{thunderforest_link}" + andy_allan: Andy Allan + opnvkarte_credit: "Tiles courtesy of %{memomaps_link}" + memomaps: MeMoMaps + hotosm_credit: "Tiles style by %{hotosm_link} hosted by %{osm_france_link}" + hotosm_name: Humanitarian OpenStreetMap Team site: edit_tooltip: Edit the map edit_disabled_tooltip: Zoom in to edit the map diff --git a/test/helpers/note_helper_test.rb b/test/helpers/note_helper_test.rb index d5f3021fb..75a0e521e 100644 --- a/test/helpers/note_helper_test.rb +++ b/test/helpers/note_helper_test.rb @@ -8,8 +8,8 @@ class NoteHelperTest < ActionView::TestCase date = Time.new(2014, 3, 5, 21, 37, 45, "+00:00") user = create(:user) - assert_match %r{^Created by anonymous .* ago$}, note_event("opened", date, nil) - assert_match %r{^Resolved by #{user.display_name} .* ago$}, note_event("closed", date, user) + assert_match %r{^Created by anonymous .* ago$}, note_event("opened", date, nil) + assert_match %r{^Resolved by #{user.display_name} .* ago$}, note_event("closed", date, user) end def test_note_author