FIX: Use user's locale for chat push notifications (#26107)

This commit is contained in:
Mark VanLandingham 2024-03-08 15:18:47 -06:00 committed by GitHub
parent 1fcd6fee29
commit 3f1566eeb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -66,11 +66,14 @@ module Jobs
translation_args, translation_args,
) )
translated_title =
I18n.with_locale(user.effective_locale) { I18n.t(translation_key, translation_args) }
payload = { payload = {
username: @creator.username, username: @creator.username,
notification_type: ::Notification.types[:chat_message], notification_type: ::Notification.types[:chat_message],
post_url: @chat_message.url, post_url: @chat_message.url,
translated_title: ::I18n.t(translation_key, translation_args), translated_title: translated_title,
tag: ::Chat::Notifier.push_notification_tag(:message, @chat_channel.id), tag: ::Chat::Notifier.push_notification_tag(:message, @chat_channel.id),
excerpt: @chat_message.push_notification_excerpt, excerpt: @chat_message.push_notification_excerpt,
} }