]> git.openstreetmap.org Git - rails.git/commitdiff
Rework the help text to avoid raw html in translations
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 29 Mar 2023 13:01:24 +0000 (14:01 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Sun, 2 Apr 2023 09:14:00 +0000 (10:14 +0100)
Unfortunately bootstrap_form has no method for passing interpolation
values to the automatic help text system, so instead we'll use an
explicit override.

app/views/users/new.html.erb
config/locales/en.yml

index f160de9130892403c41ba612c4a1269815c0c23d..27e98b45b3df544fea3f8fa7bfcc698a80d3a9e0 100644 (file)
       <%= 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 %>
 
index 9969c59bc5cc0600264e5ec19c7f3494c669bdd8..68bd5b641d164165009e07bf571e4c403727ae1f 100644 (file)
@@ -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 <a href="https://wiki.osmfoundation.org/wiki/Privacy_Policy" title="OSMF privacy policy including section on email addresses">privacy policy</a> for more information.'
         new_email: "(never displayed publicly)"
   datetime:
     distance_in_words_ago:
@@ -2623,6 +2622,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"