From 73b8898c0f454641f7c29fb3ef2f8eeda8198e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hasan=20=C3=96zoval=C4=B1?= Date: Sat, 23 Nov 2024 22:37:04 +0300 Subject: [PATCH] Fix subject locales that need a variable "host" --- app/mailers/mailer.rb | 6 +++--- app/mailers/web_hooks_mailer.rb | 4 ++-- app/views/mailer/email_confirmation.text.erb | 2 +- test/integration/notification_settings_test.rb | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index 98bda5678fe..580d865582f 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -43,12 +43,12 @@ def admin_manual(user, subject, body) def deletion_complete(email) mail to: email, - subject: I18n.t("mailer.deletion_complete.subject") + subject: I18n.t("mailer.deletion_complete.subject", host: Gemcutter::HOST_DISPLAY) end def deletion_failed(email) mail to: email, - subject: I18n.t("mailer.deletion_failed.subject") + subject: I18n.t("mailer.deletion_failed.subject", host: Gemcutter::HOST_DISPLAY) end def notifiers_changed(user_id) @@ -56,7 +56,7 @@ def notifiers_changed(user_id) @ownerships = @user.ownerships.by_indexed_gem_name mail to: @user.email, - subject: I18n.t("mailer.notifiers_changed.subject", + subject: I18n.t("mailer.notifiers_changed.subject", host: Gemcutter::HOST_DISPLAY, default: "You changed your RubyGems.org email notification settings") end diff --git a/app/mailers/web_hooks_mailer.rb b/app/mailers/web_hooks_mailer.rb index 4be2cc2f45f..ab20e5d39c7 100644 --- a/app/mailers/web_hooks_mailer.rb +++ b/app/mailers/web_hooks_mailer.rb @@ -6,7 +6,7 @@ def webhook_deleted(user_id, rubygem_id, url, failure_count) @failure_count = failure_count mail to: @user.email, - subject: t("mailer.web_hook_deleted.subject") do |format| + subject: t("mailer.web_hook_deleted.subject", host: Gemcutter::HOST_DISPLAY) do |format| format.html format.text end @@ -17,7 +17,7 @@ def webhook_disabled(web_hook) @delete_command = "gem install gemcutter && gem webhook#{" #{web_hook.rubygem.name}" unless web_hook.global?} --remove '#{web_hook.url}'" mail to: web_hook.user.email, - subject: t("mailer.web_hook_disabled.subject") do |format| + subject: t("mailer.web_hook_disabled.subject", host: Gemcutter::HOST_DISPLAY) do |format| format.html format.text end diff --git a/app/views/mailer/email_confirmation.text.erb b/app/views/mailer/email_confirmation.text.erb index 5d13c3965f4..4ce132aa9ff 100644 --- a/app/views/mailer/email_confirmation.text.erb +++ b/app/views/mailer/email_confirmation.text.erb @@ -1,4 +1,4 @@ Hi <%= @user.handle %> -<%= t("mailer.email_confirmation.welcome_message") %> +<%= t("mailer.email_confirmation.welcome_message", host: Gemcutter::HOST_DISPLAY) %> <%= update_email_confirmations_url(token: @user.confirmation_token.html_safe) %> diff --git a/test/integration/notification_settings_test.rb b/test/integration/notification_settings_test.rb index 9c377ef51b4..6737b8f4386 100644 --- a/test/integration/notification_settings_test.rb +++ b/test/integration/notification_settings_test.rb @@ -42,7 +42,7 @@ class NotificationSettingsTest < SystemTest assert_emails 1 - assert_equal I18n.t("mailer.notifiers_changed.subject"), last_email.subject + assert_equal I18n.t("mailer.notifiers_changed.subject", host: Gemcutter::HOST_DISPLAY), last_email.subject assert_selector "#flash_notice", text: I18n.t("notifiers.update.success")