Fix subject of email subscription notification e-mail being difficult to localize (#38507)
This commit is contained in:
parent
6736b50c14
commit
14544dc4dd
@ -30,7 +30,7 @@ class EmailSubscriptionMailer < ApplicationMailer
|
|||||||
@statuses = statuses
|
@statuses = statuses
|
||||||
|
|
||||||
I18n.with_locale(locale) do
|
I18n.with_locale(locale) do
|
||||||
mail subject: default_i18n_subject(count: @statuses.size, name: @subscription.account.display_name, excerpt: @statuses.first.text.truncate(17))
|
mail subject: I18n.t(@statuses.size == 1 ? 'singular' : 'plural', scope: 'email_subscription_mailer.notification.subject', name: @subscription.account.display_name, excerpt: @statuses.first.text.truncate(17))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<%= t '.title', count: @statuses.size, name: display_name(@subscription.account), excerpt: truncate(@statuses.first.text, length: 17) %>
|
<%= t @statuses.size == 1 ? 'singular' : 'plural', scope: 'email_subscription_mailer.notification.title', name: display_name(@subscription.account), excerpt: truncate(@statuses.first.text, length: 17) %>
|
||||||
|
|
||||||
===
|
===
|
||||||
|
|
||||||
|
|||||||
@ -1440,11 +1440,11 @@ en:
|
|||||||
one: Interact with this post and discover more like it.
|
one: Interact with this post and discover more like it.
|
||||||
other: Interact with these posts and discover more.
|
other: Interact with these posts and discover more.
|
||||||
subject:
|
subject:
|
||||||
one: 'New post: "%{excerpt}"'
|
plural: New posts from %{name}
|
||||||
other: New posts from %{name}
|
singular: 'New post: "%{excerpt}"'
|
||||||
title:
|
title:
|
||||||
one: 'New post: "%{excerpt}"'
|
plural: New posts from %{name}
|
||||||
other: New posts from %{name}
|
singular: 'New post: "%{excerpt}"'
|
||||||
email_subscriptions:
|
email_subscriptions:
|
||||||
active: Active
|
active: Active
|
||||||
confirmations:
|
confirmations:
|
||||||
|
|||||||
@ -30,7 +30,7 @@ RSpec.describe EmailSubscriptionMailer do
|
|||||||
.to send_email(
|
.to send_email(
|
||||||
to: email_subscription.email,
|
to: email_subscription.email,
|
||||||
from: 'notifications@localhost',
|
from: 'notifications@localhost',
|
||||||
subject: I18n.t('email_subscription_mailer.notification.subject', count: statuses.size, name: email_subscription.account.display_name, excerpt: statuses.first.text.truncate(17))
|
subject: I18n.t('email_subscription_mailer.notification.subject.singular', name: email_subscription.account.display_name, excerpt: statuses.first.text.truncate(17))
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -43,7 +43,7 @@ RSpec.describe EmailSubscriptionMailer do
|
|||||||
.to send_email(
|
.to send_email(
|
||||||
to: email_subscription.email,
|
to: email_subscription.email,
|
||||||
from: 'notifications@localhost',
|
from: 'notifications@localhost',
|
||||||
subject: I18n.t('email_subscription_mailer.notification.subject', count: statuses.size, name: email_subscription.account.display_name, excerpt: ActionController::Base.helpers.truncate(statuses.first.text, length: 17))
|
subject: I18n.t('email_subscription_mailer.notification.subject.plural', name: email_subscription.account.display_name, excerpt: ActionController::Base.helpers.truncate(statuses.first.text, length: 17))
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user