Fixed wrong language in mail notifications
authorMarcel Werk <burntime@woltlab.com>
Fri, 15 Jul 2016 14:03:25 +0000 (16:03 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 15 Jul 2016 14:03:25 +0000 (16:03 +0200)
wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php

index 899fc0127635e566f05ebb77db2a80fba8f12c0e..2d279c0872491027ddbd3ce1e9e88852abecab9f 100644 (file)
@@ -165,6 +165,7 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                                        $notification->additionalData
                                );
                                $class->setLanguage($user->getLanguage());
+                               WCF::setLanguage($user->getLanguage()->languageID);
                                
                                if (isset($authorToNotification[$notification->notificationID])) {
                                        $eventAuthors = [];
index ce8ef8d62cc58e19f1c0cb612f8a230b0e8e9f3b..acd49aaa4588e8feb20a4696ed639e30763db14e 100644 (file)
@@ -238,6 +238,9 @@ class UserNotificationHandler extends SingletonFactory {
                                                }
                                        }
                                }
+                               
+                               // reset language to current user language
+                               WCF::setLanguage(WCF::getUser()->getLanguage()->languageID);
                        }
                        
                        // reset notification count
@@ -644,6 +647,7 @@ class UserNotificationHandler extends SingletonFactory {
                
                // recipient's language
                $event->setLanguage($user->getLanguage());
+               WCF::setLanguage($user->getLanguage()->languageID);
                
                // add mail header
                $message = $user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.header', [