From 03fd275b454f2bf822f87a9170962cff44d3bff1 Mon Sep 17 00:00:00 2001 From: riking Date: Sat, 17 Jan 2015 23:14:59 -0800 Subject: [PATCH] FIX: Respect user locale for reply notifications --- app/services/post_alerter.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/services/post_alerter.rb b/app/services/post_alerter.rb index 3361d0291c5..4d5da91c00e 100644 --- a/app/services/post_alerter.rb +++ b/app/services/post_alerter.rb @@ -118,7 +118,13 @@ class PostAlerter if collapsed post = first_unread_post(user,post.topic) || post count = unread_count(user, post.topic) - opts[:display_username] = I18n.t('embed.replies', count: count) if count > 1 + I18n.with_locale(if SiteSetting.allow_user_locale && user.locale.present? + user.locale + else + SiteSetting.default_locale + end) do + opts[:display_username] = I18n.t('embed.replies', count: count) if count > 1 + end end UserActionObserver.log_notification(original_post, user, type, opts[:acting_user_id])