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