From 3f1566eeb1adb5c981851868936b97cfb296fcd4 Mon Sep 17 00:00:00 2001 From: Mark VanLandingham Date: Fri, 8 Mar 2024 15:18:47 -0600 Subject: [PATCH] FIX: Use user's locale for chat push notifications (#26107) --- plugins/chat/app/jobs/regular/chat/notify_watching.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/chat/app/jobs/regular/chat/notify_watching.rb b/plugins/chat/app/jobs/regular/chat/notify_watching.rb index 2816a1cd5e2..626a7081536 100644 --- a/plugins/chat/app/jobs/regular/chat/notify_watching.rb +++ b/plugins/chat/app/jobs/regular/chat/notify_watching.rb @@ -66,11 +66,14 @@ module Jobs translation_args, ) + translated_title = + I18n.with_locale(user.effective_locale) { I18n.t(translation_key, translation_args) } + payload = { username: @creator.username, notification_type: ::Notification.types[:chat_message], 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), excerpt: @chat_message.push_notification_excerpt, }