Restore all previously loaded translations when sending user notifications
Fixes #5087
This commit is contained in:
committed by
Frédéric Guillot
parent
ae7bc0b74d
commit
0b1c2011ed
@@ -14,10 +14,10 @@ class Translator
|
||||
* Locale
|
||||
*
|
||||
* @static
|
||||
* @access private
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
private static $locales = array();
|
||||
public static $locales = array();
|
||||
|
||||
/**
|
||||
* Instance
|
||||
|
||||
@@ -41,6 +41,7 @@ class UserNotificationModel extends Base
|
||||
*/
|
||||
public function sendUserNotification(array $user, $event_name, array $event_data)
|
||||
{
|
||||
$loadedLocales = Translator::$locales;
|
||||
Translator::unload();
|
||||
|
||||
// Use the user language otherwise use the application language (do not use the session language)
|
||||
@@ -55,7 +56,7 @@ class UserNotificationModel extends Base
|
||||
}
|
||||
|
||||
// Restore locales
|
||||
$this->languageModel->loadCurrentLanguage();
|
||||
Translator::$locales = $loadedLocales;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user