From: Marcel Werk Date: Fri, 15 Jul 2016 14:03:25 +0000 (+0200) Subject: Fixed wrong language in mail notifications X-Git-Tag: 3.0.0_Beta_1~1123 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=93c9f6ef5564d6787d21366dd6db4e4e1e752dda;p=GitHub%2FWoltLab%2FWCF.git Fixed wrong language in mail notifications --- diff --git a/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php index 899fc01276..2d279c0872 100644 --- a/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php @@ -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 = []; diff --git a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php index ce8ef8d62c..acd49aaa45 100644 --- a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php @@ -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', [