From: Andy Allan Date: Wed, 29 Mar 2023 13:01:24 +0000 (+0100) Subject: Rework the help text to avoid raw html in translations X-Git-Tag: live~1247^2~3 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/63484a169a2641d005b46fe95b01a6556d78af3a Rework the help text to avoid raw html in translations Unfortunately bootstrap_form has no method for passing interpolation values to the automatic help text system, so instead we'll use an explicit override. --- 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 9969c59bc..68bd5b641 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: @@ -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"