From 1d62d308531a8e49e5420ffbe4dd4d4ca2dfcd48 Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Thu, 7 Oct 2021 12:05:21 -0400 Subject: [PATCH] Consolidate and internationalize various 'contact us' prompts (#14951) * Consolidate and internationalize various 'contact us' prompts * Update spec/requests/user/user_settings_spec.rb Co-authored-by: Michael Kohl Co-authored-by: Michael Kohl --- app/views/devise/shared/_authorization_error.html.erb | 2 +- app/views/feedback_messages/index.html.erb | 2 +- .../mailers/notify_mailer/account_deleted_email.html.erb | 2 +- .../notify_mailer/account_deletion_requested_email.html.erb | 2 +- .../notify_mailer/account_deletion_requested_email.text.erb | 2 +- .../notify_mailer/organization_deleted_email.html.erb | 2 +- .../notify_mailer/organization_deleted_email.text.erb | 2 +- app/views/notifications/_notifications_list.html.erb | 2 +- app/views/notifications/_tagadjustment.html.erb | 3 +-- app/views/users/_account.html.erb | 4 +++- app/views/users/_publishing_from_rss.html.erb | 4 ++-- app/views/users/confirm_destroy.html.erb | 2 +- app/views/users/edit.html.erb | 4 ++-- app/views/videos/new.html.erb | 2 +- config/locales/en.yml | 4 ++++ config/locales/fr.yml | 4 ++++ spec/requests/user/user_settings_spec.rb | 5 +++++ 17 files changed, 31 insertions(+), 17 deletions(-) diff --git a/app/views/devise/shared/_authorization_error.html.erb b/app/views/devise/shared/_authorization_error.html.erb index 307de4c18..080125de3 100644 --- a/app/views/devise/shared/_authorization_error.html.erb +++ b/app/views/devise/shared/_authorization_error.html.erb @@ -20,6 +20,6 @@ <% end %> If you haven't received your confirmation email yet, click here to resend it.
- Contact <%= email_link %> if you continue having trouble. + <%= t("contact_prompts.if_continued_trouble_html") %> <% end %> diff --git a/app/views/feedback_messages/index.html.erb b/app/views/feedback_messages/index.html.erb index bc57fde8d..ddcfcedcb 100644 --- a/app/views/feedback_messages/index.html.erb +++ b/app/views/feedback_messages/index.html.erb @@ -9,7 +9,7 @@

Thank you for your report.

Return to home page

- Questions? Send an email to <%= email_link %> + <%= t("contact_prompts.if_any_questions_html") %>

diff --git a/app/views/mailers/notify_mailer/account_deleted_email.html.erb b/app/views/mailers/notify_mailer/account_deleted_email.html.erb index ef62413d9..f206d89ea 100644 --- a/app/views/mailers/notify_mailer/account_deleted_email.html.erb +++ b/app/views/mailers/notify_mailer/account_deleted_email.html.erb @@ -7,7 +7,7 @@

- Contact us at <%= email_link %> if there is anything more we can help with. ๐Ÿ˜Š + <%= t("contact_prompts.if_we_can_help_html") %> ๐Ÿ˜Š

diff --git a/app/views/mailers/notify_mailer/account_deletion_requested_email.html.erb b/app/views/mailers/notify_mailer/account_deletion_requested_email.html.erb index d35112572..ed5d73d88 100644 --- a/app/views/mailers/notify_mailer/account_deletion_requested_email.html.erb +++ b/app/views/mailers/notify_mailer/account_deletion_requested_email.html.erb @@ -8,7 +8,7 @@

- Contact us at <%= email_link %> if there is anything more we can help with. ๐Ÿ˜Š + <%= t("contact_prompts.if_we_can_help_html") %> ๐Ÿ˜Š

diff --git a/app/views/mailers/notify_mailer/account_deletion_requested_email.text.erb b/app/views/mailers/notify_mailer/account_deletion_requested_email.text.erb index 061f5cc61..3b01dc46e 100644 --- a/app/views/mailers/notify_mailer/account_deletion_requested_email.text.erb +++ b/app/views/mailers/notify_mailer/account_deletion_requested_email.text.erb @@ -1,6 +1,6 @@ Hi <%= @name %>, Your account deletion was requested. Please, visit this page: <%= user_confirm_destroy_url(@token) %> to destroy your account. The link will expire in 12 hours. -Contact us at <%= email_link %> if there is anything more we can help with. +<%= t("contact_prompts.if_we_can_help_html") %> Thanks, The <%= community_name %> Team diff --git a/app/views/mailers/notify_mailer/organization_deleted_email.html.erb b/app/views/mailers/notify_mailer/organization_deleted_email.html.erb index aa406b3df..68e46d63a 100644 --- a/app/views/mailers/notify_mailer/organization_deleted_email.html.erb +++ b/app/views/mailers/notify_mailer/organization_deleted_email.html.erb @@ -7,7 +7,7 @@

- Contact us at <%= email_link %> if there is anything more we can help with. ๐Ÿ˜Š + <%= t("contact_prompts.if_we_can_help_html") %> ๐Ÿ˜Š

diff --git a/app/views/mailers/notify_mailer/organization_deleted_email.text.erb b/app/views/mailers/notify_mailer/organization_deleted_email.text.erb index 03150fcd8..783e40251 100644 --- a/app/views/mailers/notify_mailer/organization_deleted_email.text.erb +++ b/app/views/mailers/notify_mailer/organization_deleted_email.text.erb @@ -2,7 +2,7 @@ Hi <%= @name %>. Your organization <%= @org_name %> on <%= community_name %> has been successfully deleted. -Contact us at <%= email_link %> if there is anything more we can help with. +<%= t("contact_prompts.if_we_can_help_html") %> Thanks, The <%= community_name %> Team diff --git a/app/views/notifications/_notifications_list.html.erb b/app/views/notifications/_notifications_list.html.erb index c3f113d8a..3ab3cc33a 100644 --- a/app/views/notifications/_notifications_list.html.erb +++ b/app/views/notifications/_notifications_list.html.erb @@ -10,7 +10,7 @@

An error occurred!

-

This has been logged and we're tracking it. If you see too many of these, please report it to <%= email_link %>!

+

This has been logged and we're tracking it.

<% end %> diff --git a/app/views/notifications/_tagadjustment.html.erb b/app/views/notifications/_tagadjustment.html.erb index c52ab80cf..0eca7e254 100644 --- a/app/views/notifications/_tagadjustment.html.erb +++ b/app/views/notifications/_tagadjustment.html.erb @@ -24,8 +24,7 @@

Check out other popular tags which may be more appropriate

<% end %>

- Thanks for being part of <%= community_name %>! If you feel like this mod action was a mistake, feel free to contact - <%= email_link %>. ๐Ÿค— + Thanks for being part of <%= community_name %>! <%= t("contact_prompts.if_any_questions_html") %> ๐Ÿค—

diff --git a/app/views/users/_account.html.erb b/app/views/users/_account.html.erb index 024659cce..ad8ca1d18 100644 --- a/app/views/users/_account.html.erb +++ b/app/views/users/_account.html.erb @@ -130,6 +130,8 @@
-

Feel free to contact <%= email_link %> with any questions.

+

+ <%= t("contact_prompts.if_any_questions_html") %> +

diff --git a/app/views/users/_publishing_from_rss.html.erb b/app/views/users/_publishing_from_rss.html.erb index 15771ba9c..579884601 100644 --- a/app/views/users/_publishing_from_rss.html.erb +++ b/app/views/users/_publishing_from_rss.html.erb @@ -23,8 +23,8 @@ guide.

- Your feed will be fetched every time you submit this form and updates will be automatically fetched periodically thereafter. Contact - <%= email_link %> if you encounter issues. + Your feed will be fetched every time you submit this form and updates will be automatically fetched periodically thereafter. + <%= t("contact_prompts.if_any_questions_html") %>

FYI: Medium RSS feed URLs are https://medium.com/feed/@your_username

By submitting your RSS Feed URL, you agree that you own and/or have permission to syndicate the associated content.

diff --git a/app/views/users/confirm_destroy.html.erb b/app/views/users/confirm_destroy.html.erb index a9294b9de..1883ea640 100644 --- a/app/views/users/confirm_destroy.html.erb +++ b/app/views/users/confirm_destroy.html.erb @@ -50,7 +50,7 @@

- Feel free to contact <%= email_link %> with any questions. + <%= t("contact_prompts.if_any_questions_html") %>

diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 17c67a4b2..9e7e8041a 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -15,8 +15,8 @@ <% if params[:state] == "previous-registration" %> <% end %> diff --git a/app/views/videos/new.html.erb b/app/views/videos/new.html.erb index 7dc0f5f31..166fb981e 100644 --- a/app/views/videos/new.html.erb +++ b/app/views/videos/new.html.erb @@ -33,7 +33,7 @@ <% end %>

- Video is beta: Email <%= email_link %> if you have any problems. + Video is beta: <%= t("contact_prompts.if_any_questions_html") %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 9c7294cd1..063f8b59f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -39,6 +39,10 @@ en: view: View week: Week year: Year + contact_prompts: + if_continued_trouble_html: Contact us if you continue having trouble. + if_we_can_help_html: Contact us if there is anything we can help with. + if_any_questions_html: Contact us if you have any questions. dashboard: following_users: Following users loading: loading... diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 832eaa570..ecea20268 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -39,6 +39,10 @@ fr: view: Vue week: Semaine year: Annรฉe + contact_prompts: + if_continued_trouble_html: Contactez-nous si vous continuez ร  avoir des problรจmes. + if_we_can_help_html: Contactez-nous si nous pouvons vous aider. + if_any_questions_html: Contactez-nous si vous avez des questions. dashboard: following_users: Utilisateurs suivis loading: Chargement en cours... diff --git a/spec/requests/user/user_settings_spec.rb b/spec/requests/user/user_settings_spec.rb index 04b0b9db3..ef6ab27e6 100644 --- a/spec/requests/user/user_settings_spec.rb +++ b/spec/requests/user/user_settings_spec.rb @@ -88,6 +88,11 @@ RSpec.describe "UserSettings", type: :request do expect(response.body).to include(*titles) end + it "includes contact us on RSS page properly" do + get user_settings_path(:extensions) + expect(response.body).to include(I18n.t("contact_prompts.if_any_questions_html")) + end + it "renders heads up dupe account message with proper param" do get "/settings?state=previous-registration"