summaryrefslogtreecommitdiffstats
path: root/apps/sharebymail
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-12-01 23:01:00 +0100
committerGitHub <noreply@github.com>2016-12-01 23:01:00 +0100
commitac1bf3c2b7e0a820d68bf50d57f602a01a714d43 (patch)
treecf4e4b8ac856204e9a44001308a6cebecfd06cea /apps/sharebymail
parentea45b220535310f063a4785f2281c96b7c7c2581 (diff)
parentb2f46bfa04fdd6f205fba1a5d4011a9e5c5637dd (diff)
downloadnextcloud-server-ac1bf3c2b7e0a820d68bf50d57f602a01a714d43.tar.gz
nextcloud-server-ac1bf3c2b7e0a820d68bf50d57f602a01a714d43.zip
Merge pull request #2432 from nextcloud/activity-mail-language
Make sure the activity emails can be sent in the users language
Diffstat (limited to 'apps/sharebymail')
-rw-r--r--apps/sharebymail/lib/Activity.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/sharebymail/lib/Activity.php b/apps/sharebymail/lib/Activity.php
index 58ab0a5cdcd..5342d013ade 100644
--- a/apps/sharebymail/lib/Activity.php
+++ b/apps/sharebymail/lib/Activity.php
@@ -29,9 +29,13 @@ use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserManager;
+use OCP\L10N\IFactory;
class Activity implements IProvider {
+ /** @var IFactory */
+ protected $languageFactory;
+
/** @var IL10N */
protected $l;
@@ -56,14 +60,14 @@ class Activity implements IProvider {
const SUBJECT_SHARED_EMAIL_BY = 'shared_with_email_by';
/**
- * @param IL10N $l
+ * @param IFactory $languageFactory
* @param IURLGenerator $url
* @param IManager $activityManager
* @param IUserManager $userManager
* @param IContactsManager $contactsManager
*/
- public function __construct(IL10N $l, IURLGenerator $url, IManager $activityManager, IUserManager $userManager, IContactsManager $contactsManager) {
- $this->l = $l;
+ public function __construct(IFactory $languageFactory, IURLGenerator $url, IManager $activityManager, IUserManager $userManager, IContactsManager $contactsManager) {
+ $this->languageFactory = $languageFactory;
$this->url = $url;
$this->activityManager = $activityManager;
$this->userManager = $userManager;
@@ -71,17 +75,20 @@ class Activity implements IProvider {
}
/**
+ * @param string $language
* @param IEvent $event
* @param IEvent|null $previousEvent
* @return IEvent
* @throws \InvalidArgumentException
* @since 11.0.0
*/
- public function parse(IEvent $event, IEvent $previousEvent = null) {
+ public function parse($language, IEvent $event, IEvent $previousEvent = null) {
if ($event->getApp() !== 'sharebymail') {
throw new \InvalidArgumentException();
}
+ $this->l = $this->languageFactory->get('sharebymail', $language);
+
if ($this->activityManager->isFormattingFilteredObject()) {
try {
return $this->parseShortVersion($event);