Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRené Gieling <github@dartcafe.de>2022-01-28 10:34:38 +0300
committerGitHub <noreply@github.com>2022-01-28 10:34:38 +0300
commitb740bf1ca2a8575684f97cbc1168a7c1e0918733 (patch)
treed57d35bee1fbaf9665123a6de1ec64b5131d0c88 /lib
parentbfd5a6b736ff47c822ccb921171576aa29e1ddbb (diff)
parent09892e5edbba97b8c8e09fa1f26599a4faecda77 (diff)
Merge branch 'master' into ref/mail-classes
Diffstat (limited to 'lib')
-rw-r--r--lib/Activity/PollChanges.php13
-rw-r--r--lib/Controller/PreferencesController.php2
-rw-r--r--lib/Provider/ActivityProvider.php4
-rw-r--r--lib/Provider/SearchProvider.php4
-rw-r--r--lib/Service/ActivityService.php256
-rw-r--r--lib/Settings/ActivitySettings.php10
-rw-r--r--lib/Settings/ActivityVote.php2
-rw-r--r--lib/Settings/AdminSection.php8
-rw-r--r--lib/Settings/PersonalSection.php8
9 files changed, 155 insertions, 152 deletions
diff --git a/lib/Activity/PollChanges.php b/lib/Activity/PollChanges.php
index 14b1956d..881d9c99 100644
--- a/lib/Activity/PollChanges.php
+++ b/lib/Activity/PollChanges.php
@@ -29,17 +29,20 @@ use OCP\IURLGenerator;
class PollChanges implements IFilter {
/** @var IL10N */
- protected $trans;
+ protected $l10n;
/** @var IURLGenerator */
protected $urlGenerator;
/**
- * @param IL10N $trans
+ * @param IL10N $l10n
* @param IURLGenerator $urlGenerator
*/
- public function __construct(IL10N $trans, IURLGenerator $urlGenerator) {
- $this->trans = $trans;
+ public function __construct(
+ IL10N $l10n,
+ IURLGenerator $urlGenerator
+ ) {
+ $this->l10n = $l10n;
$this->urlGenerator = $urlGenerator;
}
@@ -48,7 +51,7 @@ class PollChanges implements IFilter {
}
public function getName() : string {
- return $this->trans->t('Poll changes');
+ return $this->l10n->t('Poll changes');
}
public function getIcon() : string {
diff --git a/lib/Controller/PreferencesController.php b/lib/Controller/PreferencesController.php
index 1da027d5..5d26c41a 100644
--- a/lib/Controller/PreferencesController.php
+++ b/lib/Controller/PreferencesController.php
@@ -74,7 +74,7 @@ class PreferencesController extends Controller {
* @NoAdminRequired
*/
public function write(array $settings): DataResponse {
- if ($this->userSession->isLoggedIn()) {
+ if (!$this->userSession->isLoggedIn()) {
return new DataResponse([], Http::STATUS_OK);
}
return $this->response(function () use ($settings) {
diff --git a/lib/Provider/ActivityProvider.php b/lib/Provider/ActivityProvider.php
index e81f1e75..5992b909 100644
--- a/lib/Provider/ActivityProvider.php
+++ b/lib/Provider/ActivityProvider.php
@@ -40,7 +40,7 @@ class ActivityProvider implements IProvider {
protected $transFactory;
/** @var IL10N */
- protected $trans;
+ protected $l10n;
/** @var ActivityManager */
protected $activityManager;
@@ -92,7 +92,7 @@ class ActivityProvider implements IProvider {
throw new \InvalidArgumentException();
}
- $this->trans = $this->transFactory->get($event->getApp(), $language);
+ $this->l10n = $this->transFactory->get($event->getApp(), $language);
$event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath($event->getApp(), 'polls-black.svg')));
$this->setSubjects($event, $this->activityService->getActivityMessage($event, $language, $this->activityManager->isFormattingFilteredObject()));
return $event;
diff --git a/lib/Provider/SearchProvider.php b/lib/Provider/SearchProvider.php
index e276b70a..129db3eb 100644
--- a/lib/Provider/SearchProvider.php
+++ b/lib/Provider/SearchProvider.php
@@ -66,7 +66,7 @@ class SearchProvider implements IProvider {
}
public function getName(): string {
- return $this->l10n->t('polls', 'Polls');
+ return $this->l10n->t('Polls');
}
public function search(IUser $user, ISearchQuery $query): SearchResult {
@@ -85,7 +85,7 @@ class SearchProvider implements IProvider {
}, $results);
return SearchResult::complete(
- $this->l10n->t('polls', 'Polls'),
+ $this->l10n->t('Polls'),
$resultEntries
);
}
diff --git a/lib/Service/ActivityService.php b/lib/Service/ActivityService.php
index 55eb9cf4..55530292 100644
--- a/lib/Service/ActivityService.php
+++ b/lib/Service/ActivityService.php
@@ -44,7 +44,7 @@ class ActivityService {
protected $transFactory;
/** @var IL10N */
- protected $trans;
+ protected $l10n;
/** @var IUserSession */
private $userSession;
@@ -85,7 +85,7 @@ class ActivityService {
}
public function getActivityMessage(ActivityEvent $event, string $language, bool $filtered = false) : string {
- $this->trans = $this->transFactory->get($event->getApp(), $language);
+ $this->l10n = $this->transFactory->get($event->getApp(), $language);
$this->userIsActor = $event->getAuthor() === $this->userSession->getUser()->getUID();
$this->eventType = $event->getType();
$parameters = $event->getSubjectParameters();
@@ -100,275 +100,275 @@ class ActivityService {
switch ($this->eventType) {
case CommentEvent::ADD:
return $this->userIsActor
- ? $this->trans->t('You have commented on poll {pollTitle}')
- : $this->trans->t('{actor} has commented on poll {pollTitle}');
+ ? $this->l10n->t('You have commented on poll {pollTitle}')
+ : $this->l10n->t('{actor} has commented on poll {pollTitle}');
case CommentEvent::DELETE:
return $this->userIsActor
- ? $this->trans->t('You have deleted a comment from poll {pollTitle}')
- : $this->trans->t('{actor} has deleted a comment from poll {pollTitle}');
+ ? $this->l10n->t('You have deleted a comment from poll {pollTitle}')
+ : $this->l10n->t('{actor} has deleted a comment from poll {pollTitle}');
case OptionEvent::ADD:
return $this->userIsActor
- ? $this->trans->t('You have added an option to poll {pollTitle}')
- : $this->trans->t('{actor} has added an option to poll {pollTitle}');
+ ? $this->l10n->t('You have added an option to poll {pollTitle}')
+ : $this->l10n->t('{actor} has added an option to poll {pollTitle}');
case OptionEvent::UPDATE:
return $this->userIsActor
- ? $this->trans->t('You have changed an option of poll {pollTitle}')
- : $this->trans->t('{actor} has changed an option of poll {pollTitle}');
+ ? $this->l10n->t('You have changed an option of poll {pollTitle}')
+ : $this->l10n->t('{actor} has changed an option of poll {pollTitle}');
case OptionEvent::CONFIRM:
return $this->userIsActor
- ? $this->trans->t('You have confirmed option {optionTitle} of poll {pollTitle}')
- : $this->trans->t('{actor} has confirmed option {optionTitle} of poll {pollTitle}');
+ ? $this->l10n->t('You have confirmed option {optionTitle} of poll {pollTitle}')
+ : $this->l10n->t('{actor} has confirmed option {optionTitle} of poll {pollTitle}');
case OptionEvent::UNCONFIRM:
return $this->userIsActor
- ? $this->trans->t('You have unconfirmed option {optionTitle} of poll {pollTitle}')
- : $this->trans->t('{actor} has unconfirmed option {optionTitle} of poll {pollTitle}');
+ ? $this->l10n->t('You have unconfirmed option {optionTitle} of poll {pollTitle}')
+ : $this->l10n->t('{actor} has unconfirmed option {optionTitle} of poll {pollTitle}');
case OptionEvent::DELETE:
return $this->userIsActor
- ? $this->trans->t('You have removed option {optionTitle} from poll {pollTitle}')
- : $this->trans->t('{actor} has removed option {optionTitle} from poll {pollTitle}');
+ ? $this->l10n->t('You have removed option {optionTitle} from poll {pollTitle}')
+ : $this->l10n->t('{actor} has removed option {optionTitle} from poll {pollTitle}');
case PollEvent::ADD:
return $this->userIsActor
- ? $this->trans->t('You have added poll {pollTitle}')
- : $this->trans->t('{actor} has added poll {pollTitle}');
+ ? $this->l10n->t('You have added poll {pollTitle}')
+ : $this->l10n->t('{actor} has added poll {pollTitle}');
case PollEvent::UPDATE:
return $this->userIsActor
- ? $this->trans->t('You have changed the configuration of poll {pollTitle}')
- : $this->trans->t('{actor} has changed the configuration of poll {pollTitle}');
+ ? $this->l10n->t('You have changed the configuration of poll {pollTitle}')
+ : $this->l10n->t('{actor} has changed the configuration of poll {pollTitle}');
case PollEvent::DELETE:
return $this->userIsActor
- ? $this->trans->t('You have archived poll {pollTitle}')
- : $this->trans->t('{actor} has archived poll {pollTitle}');
+ ? $this->l10n->t('You have archived poll {pollTitle}')
+ : $this->l10n->t('{actor} has archived poll {pollTitle}');
case PollEvent::RESTORE:
return $this->userIsActor
- ? $this->trans->t('You have restored poll {pollTitle}')
- : $this->trans->t('{actor} has restored poll {pollTitle}');
+ ? $this->l10n->t('You have restored poll {pollTitle}')
+ : $this->l10n->t('{actor} has restored poll {pollTitle}');
case PollEvent::EXPIRE:
- return $this->trans->t('Poll {pollTitle} has been closed');
+ return $this->l10n->t('Poll {pollTitle} has been closed');
case PollEvent::OWNER_CHANGE:
return $this->userIsActor
- ? $this->trans->t('You have changed the owner of poll {pollTitle}')
- : $this->trans->t('{actor} has changed the owner of poll {pollTitle}');
+ ? $this->l10n->t('You have changed the owner of poll {pollTitle}')
+ : $this->l10n->t('{actor} has changed the owner of poll {pollTitle}');
case PollEvent::OPTION_REORDER:
return $this->userIsActor
- ? $this->trans->t('You have reordered the options of poll {pollTitle}')
- : $this->trans->t('{actor} has reordered the options of poll {pollTitle}');
+ ? $this->l10n->t('You have reordered the options of poll {pollTitle}')
+ : $this->l10n->t('{actor} has reordered the options of poll {pollTitle}');
case ShareEvent::ADD:
if ($this->shareType === Share::TYPE_PUBLIC) {
return $this->userIsActor
- ? $this->trans->t('You have added a public share to poll {pollTitle}')
- : $this->trans->t('{actor} has added a public share to poll {pollTitle}');
+ ? $this->l10n->t('You have added a public share to poll {pollTitle}')
+ : $this->l10n->t('{actor} has added a public share to poll {pollTitle}');
} elseif ($this->shareType === Share::TYPE_GROUP) {
return $this->userIsActor
- ? $this->trans->t('You have shared poll {pollTitle} with group {sharee}')
- : $this->trans->t('{actor} has shared poll {pollTitle} with group {sharee}');
+ ? $this->l10n->t('You have shared poll {pollTitle} with group {sharee}')
+ : $this->l10n->t('{actor} has shared poll {pollTitle} with group {sharee}');
} elseif ($this->shareType === Share::TYPE_CIRCLE) {
return $this->userIsActor
- ? $this->trans->t('You have shared poll {pollTitle} with circle {sharee}')
- : $this->trans->t('{actor} has shared poll {pollTitle} with circle {sharee}');
+ ? $this->l10n->t('You have shared poll {pollTitle} with circle {sharee}')
+ : $this->l10n->t('{actor} has shared poll {pollTitle} with circle {sharee}');
} elseif ($this->shareType === Share::TYPE_CONTACTGROUP) {
return $this->userIsActor
- ? $this->trans->t('You have shared poll {pollTitle} with contact group {sharee}')
- : $this->trans->t('{actor} has shared poll {pollTitle} with contact group {sharee}');
+ ? $this->l10n->t('You have shared poll {pollTitle} with contact group {sharee}')
+ : $this->l10n->t('{actor} has shared poll {pollTitle} with contact group {sharee}');
}
return $this->userIsActor
- ? $this->trans->t('You have shared poll {pollTitle} with {sharee}')
- : $this->trans->t('{actor} has shared poll {pollTitle} with {sharee}');
+ ? $this->l10n->t('You have shared poll {pollTitle} with {sharee}')
+ : $this->l10n->t('{actor} has shared poll {pollTitle} with {sharee}');
case ShareEvent::CHANGE_EMAIL:
return $this->userIsActor
- ? $this->trans->t('You have changed your email address')
- : $this->trans->t('{sharee} has changed his email address');
+ ? $this->l10n->t('You have changed your email address')
+ : $this->l10n->t('{sharee} has changed his email address');
case ShareEvent::CHANGE_TYPE:
return $this->userIsActor
- ? $this->trans->t('You have changed the share type')
- : $this->trans->t('{actor} has changed the share type');
+ ? $this->l10n->t('You have changed the share type')
+ : $this->l10n->t('{actor} has changed the share type');
case ShareEvent::CHANGE_REG_CONSTR:
return $this->userIsActor
- ? $this->trans->t('You have changed the registration constraints for share {sharee}')
- : $this->trans->t('{actor} has changed the registration constraints for share {sharee}');
+ ? $this->l10n->t('You have changed the registration constraints for share {sharee}')
+ : $this->l10n->t('{actor} has changed the registration constraints for share {sharee}');
case ShareEvent::REGISTRATION:
return $this->userIsActor
- ? $this->trans->t('You have registered to poll {pollTitle}')
- : $this->trans->t('{sharee} registered to poll {pollTitle}');
+ ? $this->l10n->t('You have registered to poll {pollTitle}')
+ : $this->l10n->t('{sharee} registered to poll {pollTitle}');
case ShareEvent::DELETE:
if ($this->shareType === Share::TYPE_PUBLIC) {
return $this->userIsActor
- ? $this->trans->t('You have deleted a public share from poll {pollTitle}')
- : $this->trans->t('{actor} has deleted a public share from poll {pollTitle}');
+ ? $this->l10n->t('You have deleted a public share from poll {pollTitle}')
+ : $this->l10n->t('{actor} has deleted a public share from poll {pollTitle}');
} elseif ($this->shareType === Share::TYPE_GROUP) {
return $this->userIsActor
- ? $this->trans->t('You have deleted the share for group {sharee} from poll {pollTitle}')
- : $this->trans->t('{actor} has deleted the share for group {sharee} from poll {pollTitle}');
+ ? $this->l10n->t('You have deleted the share for group {sharee} from poll {pollTitle}')
+ : $this->l10n->t('{actor} has deleted the share for group {sharee} from poll {pollTitle}');
} elseif ($this->shareType === Share::TYPE_USER) {
return $this->userIsActor
- ? $this->trans->t('You have deleted the share for {sharee} from poll {pollTitle}')
- : $this->trans->t('{actor} has deleted the share for {sharee} from poll {pollTitle}');
+ ? $this->l10n->t('You have deleted the share for {sharee} from poll {pollTitle}')
+ : $this->l10n->t('{actor} has deleted the share for {sharee} from poll {pollTitle}');
} elseif ($this->shareType === Share::TYPE_EMAIL) {
return $this->userIsActor
- ? $this->trans->t('You have deleted the share for {sharee} from poll {pollTitle}')
- : $this->trans->t('{actor} has deleted the share for {sharee} from poll {pollTitle}');
+ ? $this->l10n->t('You have deleted the share for {sharee} from poll {pollTitle}')
+ : $this->l10n->t('{actor} has deleted the share for {sharee} from poll {pollTitle}');
} elseif ($this->shareType === Share::TYPE_CONTACT) {
return $this->userIsActor
- ? $this->trans->t('You have deleted the share for {sharee} from poll {pollTitle}')
- : $this->trans->t('{actor} has deleted the share for {sharee} from poll {pollTitle}');
+ ? $this->l10n->t('You have deleted the share for {sharee} from poll {pollTitle}')
+ : $this->l10n->t('{actor} has deleted the share for {sharee} from poll {pollTitle}');
} elseif ($this->shareType === Share::TYPE_EXTERNAL) {
return $this->userIsActor
- ? $this->trans->t('You have deleted the share for {sharee} from poll {pollTitle}')
- : $this->trans->t('{actor} has deleted the share for {sharee} from poll {pollTitle}');
+ ? $this->l10n->t('You have deleted the share for {sharee} from poll {pollTitle}')
+ : $this->l10n->t('{actor} has deleted the share for {sharee} from poll {pollTitle}');
} elseif ($this->shareType === Share::TYPE_CIRCLE) {
return $this->userIsActor
- ? $this->trans->t('You have deleted the share for circle {sharee} from poll {pollTitle}')
- : $this->trans->t('{actor} has deleted the share for circle {sharee} from poll {pollTitle}');
+ ? $this->l10n->t('You have deleted the share for circle {sharee} from poll {pollTitle}')
+ : $this->l10n->t('{actor} has deleted the share for circle {sharee} from poll {pollTitle}');
} elseif ($this->shareType === Share::TYPE_CONTACTGROUP) {
return $this->userIsActor
- ? $this->trans->t('You have deleted the share for contact group {sharee} from poll {pollTitle}')
- : $this->trans->t('{actor} has deleted the share for contact group {sharee} from poll {pollTitle}');
+ ? $this->l10n->t('You have deleted the share for contact group {sharee} from poll {pollTitle}')
+ : $this->l10n->t('{actor} has deleted the share for contact group {sharee} from poll {pollTitle}');
}
return $this->userIsActor
- ? $this->trans->t('You have deleted a share from poll {pollTitle}')
- : $this->trans->t('{actor} has deleted a share from poll {pollTitle}');
+ ? $this->l10n->t('You have deleted a share from poll {pollTitle}')
+ : $this->l10n->t('{actor} has deleted a share from poll {pollTitle}');
case VoteEvent::SET:
return $this->userIsActor
- ? $this->trans->t('You have voted in poll {pollTitle}')
- : $this->trans->t('{actor} has voted in poll {pollTitle}');
+ ? $this->l10n->t('You have voted in poll {pollTitle}')
+ : $this->l10n->t('{actor} has voted in poll {pollTitle}');
}
return $this->userIsActor
- ? $this->trans->t('You have done something indescribable with poll {pollTitle}')
- : $this->trans->t('{actor} has done something indescribable with poll {pollTitle}');
+ ? $this->l10n->t('You have done something indescribable with poll {pollTitle}')
+ : $this->l10n->t('{actor} has done something indescribable with poll {pollTitle}');
}
private function getMessageFiltered(): string {
switch ($this->eventType) {
case CommentEvent::ADD:
return $this->userIsActor
- ? $this->trans->t('You have commented')
- : $this->trans->t('{actor} has commented');
+ ? $this->l10n->t('You have commented')
+ : $this->l10n->t('{actor} has commented');
case CommentEvent::DELETE:
return $this->userIsActor
- ? $this->trans->t('You have deleted a comment')
- : $this->trans->t('{actor} has deleted a comment');
+ ? $this->l10n->t('You have deleted a comment')
+ : $this->l10n->t('{actor} has deleted a comment');
case OptionEvent::ADD:
return $this->userIsActor
- ? $this->trans->t('You have added an option')
- : $this->trans->t('{actor} has added an option');
+ ? $this->l10n->t('You have added an option')
+ : $this->l10n->t('{actor} has added an option');
case OptionEvent::UPDATE:
return $this->userIsActor
- ? $this->trans->t('You have changed an option')
- : $this->trans->t('{actor} has changed an option');
+ ? $this->l10n->t('You have changed an option')
+ : $this->l10n->t('{actor} has changed an option');
case OptionEvent::CONFIRM:
return $this->userIsActor
- ? $this->trans->t('You have confirmed option {optionTitle}')
- : $this->trans->t('{actor} has confirmed option {optionTitle}');
+ ? $this->l10n->t('You have confirmed option {optionTitle}')
+ : $this->l10n->t('{actor} has confirmed option {optionTitle}');
case OptionEvent::UNCONFIRM:
return $this->userIsActor
- ? $this->trans->t('You have unconfirmed option {optionTitle}')
- : $this->trans->t('{actor} has unconfirmed option {optionTitle}');
+ ? $this->l10n->t('You have unconfirmed option {optionTitle}')
+ : $this->l10n->t('{actor} has unconfirmed option {optionTitle}');
case OptionEvent::DELETE:
return $this->userIsActor
- ? $this->trans->t('You have removed option {optionTitle}')
- : $this->trans->t('{actor} has removed option {optionTitle}');
+ ? $this->l10n->t('You have removed option {optionTitle}')
+ : $this->l10n->t('{actor} has removed option {optionTitle}');
case PollEvent::ADD:
return $this->userIsActor
- ? $this->trans->t('You have created this poll')
- : $this->trans->t('{actor} has created this poll');
+ ? $this->l10n->t('You have created this poll')
+ : $this->l10n->t('{actor} has created this poll');
case PollEvent::UPDATE:
return $this->userIsActor
- ? $this->trans->t('You have changed the configuration')
- : $this->trans->t('{actor} has changed the configuration');
+ ? $this->l10n->t('You have changed the configuration')
+ : $this->l10n->t('{actor} has changed the configuration');
case PollEvent::DELETE:
return $this->userIsActor
- ? $this->trans->t('You have archived this poll')
- : $this->trans->t('{actor} has archived this poll');
+ ? $this->l10n->t('You have archived this poll')
+ : $this->l10n->t('{actor} has archived this poll');
case PollEvent::RESTORE:
return $this->userIsActor
- ? $this->trans->t('You have restored this poll')
- : $this->trans->t('{actor} has restored this poll');
+ ? $this->l10n->t('You have restored this poll')
+ : $this->l10n->t('{actor} has restored this poll');
case PollEvent::EXPIRE:
- return $this->trans->t('This poll has been closed');
+ return $this->l10n->t('This poll has been closed');
case PollEvent::OWNER_CHANGE:
return $this->userIsActor
- ? $this->trans->t('You have changed the poll owner')
- : $this->trans->t('{actor} has changed the poll owner');
+ ? $this->l10n->t('You have changed the poll owner')
+ : $this->l10n->t('{actor} has changed the poll owner');
case PollEvent::OPTION_REORDER:
return $this->userIsActor
- ? $this->trans->t('You have reordered the options')
- : $this->trans->t('{actor} has reordered the options');
+ ? $this->l10n->t('You have reordered the options')
+ : $this->l10n->t('{actor} has reordered the options');
case ShareEvent::ADD:
if ($this->shareType === Share::TYPE_PUBLIC) {
return $this->userIsActor
- ? $this->trans->t('You have added a public share')
- : $this->trans->t('{actor} has added a public share');
+ ? $this->l10n->t('You have added a public share')
+ : $this->l10n->t('{actor} has added a public share');
} elseif ($this->shareType === Share::TYPE_GROUP) {
return $this->userIsActor
- ? $this->trans->t('You have shared this poll with group {sharee}')
- : $this->trans->t('{actor} has shared this poll with group {sharee}');
+ ? $this->l10n->t('You have shared this poll with group {sharee}')
+ : $this->l10n->t('{actor} has shared this poll with group {sharee}');
} elseif ($this->shareType === Share::TYPE_CIRCLE) {
return $this->userIsActor
- ? $this->trans->t('You have shared this poll with circle {sharee}')
- : $this->trans->t('{actor} has shared this poll with circle {sharee}');
+ ? $this->l10n->t('You have shared this poll with circle {sharee}')
+ : $this->l10n->t('{actor} has shared this poll with circle {sharee}');
} elseif ($this->shareType === Share::TYPE_CONTACTGROUP) {
return $this->userIsActor
- ? $this->trans->t('You have shared this poll with contact group {sharee}')
- : $this->trans->t('{actor} has shared this poll with contact group {sharee}');
+ ? $this->l10n->t('You have shared this poll with contact group {sharee}')
+ : $this->l10n->t('{actor} has shared this poll with contact group {sharee}');
}
return $this->userIsActor
- ? $this->trans->t('You have shared this poll with {sharee}')
- : $this->trans->t('{actor} has shared this poll with {sharee}');
+ ? $this->l10n->t('You have shared this poll with {sharee}')
+ : $this->l10n->t('{actor} has shared this poll with {sharee}');
case ShareEvent::CHANGE_EMAIL:
return $this->userIsActor
- ? $this->trans->t('You have changed your email address')
- : $this->trans->t('Email address of {sharee} has been changed');
+ ? $this->l10n->t('You have changed your email address')
+ : $this->l10n->t('Email address of {sharee} has been changed');
case ShareEvent::CHANGE_TYPE:
return $this->userIsActor
- ? $this->trans->t('You have changed the share type')
- : $this->trans->t('{actor} has changed the share type');
+ ? $this->l10n->t('You have changed the share type')
+ : $this->l10n->t('{actor} has changed the share type');
case ShareEvent::CHANGE_REG_CONSTR:
return $this->userIsActor
- ? $this->trans->t('You have changed the registration constraints for share {sharee}')
- : $this->trans->t('{actor} has changed the registration constraints for share {sharee}');
+ ? $this->l10n->t('You have changed the registration constraints for share {sharee}')
+ : $this->l10n->t('{actor} has changed the registration constraints for share {sharee}');
case ShareEvent::REGISTRATION:
return $this->userIsActor
- ? $this->trans->t('You have registered')
- : $this->trans->t('{sharee} has registered');
+ ? $this->l10n->t('You have registered')
+ : $this->l10n->t('{sharee} has registered');
case ShareEvent::DELETE:
if ($this->shareType === Share::TYPE_PUBLIC) {
return $this->userIsActor
- ? $this->trans->t('You have deleted a public share')
- : $this->trans->t('{actor} has deleted a public share');
+ ? $this->l10n->t('You have deleted a public share')
+ : $this->l10n->t('{actor} has deleted a public share');
} elseif ($this->shareType === Share::TYPE_GROUP) {
return $this->userIsActor
- ? $this->trans->t('You have deleted the share for group {sharee}')
- : $this->trans->t('{actor} has deleted the share for group {sharee}');
+ ? $this->l10n->t('You have deleted the share for group {sharee}')
+ : $this->l10n->t('{actor} has deleted the share for group {sharee}');
} elseif ($this->shareType === Share::TYPE_CIRCLE) {
return $this->userIsActor
- ? $this->trans->t('You have deleted the share for circle {sharee}')
- : $this->trans->t('{actor} has deleted the share for circle {sharee}');
+ ? $this->l10n->t('You have deleted the share for circle {sharee}')
+ : $this->l10n->t('{actor} has deleted the share for circle {sharee}');
} elseif ($this->shareType === Share::TYPE_CONTACTGROUP) {
return $this->userIsActor
- ? $this->trans->t('You have deleted the share for contact group {sharee}')
- : $this->trans->t('{actor} has deleted the share for contact group {sharee}');
+ ? $this->l10n->t('You have deleted the share for contact group {sharee}')
+ : $this->l10n->t('{actor} has deleted the share for contact group {sharee}');
}
return $this->userIsActor
- ? $this->trans->t('You have deleted share of {sharee}')
- : $this->trans->t('{actor} has deleted a share');
+ ? $this->l10n->t('You have deleted share of {sharee}')
+ : $this->l10n->t('{actor} has deleted a share');
case VoteEvent::SET:
return $this->userIsActor
- ? $this->trans->t('You have voted')
- : $this->trans->t('{actor} has voted');
+ ? $this->l10n->t('You have voted')
+ : $this->l10n->t('{actor} has voted');
}
return $this->userIsActor
- ? $this->trans->t('You have done something indescribable with this poll')
- : $this->trans->t('{actor} has done something indescribable with this poll');
+ ? $this->l10n->t('You have done something indescribable with this poll')
+ : $this->l10n->t('{actor} has done something indescribable with this poll');
}
}
diff --git a/lib/Settings/ActivitySettings.php b/lib/Settings/ActivitySettings.php
index 3298f745..1c0c9d6c 100644
--- a/lib/Settings/ActivitySettings.php
+++ b/lib/Settings/ActivitySettings.php
@@ -29,13 +29,13 @@ use OCP\Activity\ISetting;
class ActivitySettings implements ISetting {
/** @var IL10N */
- protected $l;
+ protected $l10n;
/**
- * @param IL10N $l
+ * @param IL10N $l10n
*/
- public function __construct(IL10N $l) {
- $this->l = $l;
+ public function __construct(IL10N $l10n) {
+ $this->l10n = $l10n;
}
public function getIdentifier() : string {
@@ -43,7 +43,7 @@ class ActivitySettings implements ISetting {
}
public function getName() : string {
- return $this->l->t('Events happening inside of a <strong>poll</strong>');
+ return $this->l10n->t('Events happening inside of a <strong>poll</strong>');
}
public function getPriority() : int {
diff --git a/lib/Settings/ActivityVote.php b/lib/Settings/ActivityVote.php
index 33974529..829e2252 100644
--- a/lib/Settings/ActivityVote.php
+++ b/lib/Settings/ActivityVote.php
@@ -29,6 +29,6 @@ class ActivityVote extends ActivitySettings {
}
public function getName() : string {
- return $this->l->t('Someone voted inside a <strong>poll</strong>');
+ return $this->l10n->t('Someone voted inside a <strong>poll</strong>');
}
}
diff --git a/lib/Settings/AdminSection.php b/lib/Settings/AdminSection.php
index 797232d8..4f7883ce 100644
--- a/lib/Settings/AdminSection.php
+++ b/lib/Settings/AdminSection.php
@@ -30,13 +30,13 @@ use OCP\Settings\IIconSection;
class AdminSection implements IIconSection {
/** @var IL10N */
- private $trans;
+ private $l10n;
/** @var IURLGenerator */
private $urlGenerator;
- public function __construct(IL10N $trans, IURLGenerator $urlGenerator) {
- $this->trans = $trans;
+ public function __construct(IL10N $l10n, IURLGenerator $urlGenerator) {
+ $this->l10n = $l10n;
$this->urlGenerator = $urlGenerator;
}
@@ -45,7 +45,7 @@ class AdminSection implements IIconSection {
}
public function getName(): string {
- return $this->trans->t('Polls');
+ return $this->l10n->t('Polls');
}
public function getPriority(): int {
diff --git a/lib/Settings/PersonalSection.php b/lib/Settings/PersonalSection.php
index c7951f5b..d195e1a9 100644
--- a/lib/Settings/PersonalSection.php
+++ b/lib/Settings/PersonalSection.php
@@ -30,13 +30,13 @@ use OCP\Settings\IIconSection;
class PersonalSection implements IIconSection {
/** @var IL10N */
- private $trans;
+ private $l10n;
/** @var IURLGenerator */
private $urlGenerator;
- public function __construct(IL10N $trans, IURLGenerator $urlGenerator) {
- $this->trans = $trans;
+ public function __construct(IL10N $l10n, IURLGenerator $urlGenerator) {
+ $this->l10n = $l10n;
$this->urlGenerator = $urlGenerator;
}
@@ -45,7 +45,7 @@ class PersonalSection implements IIconSection {
}
public function getName(): string {
- return $this->trans->t('Polls');
+ return $this->l10n->t('Polls');
}
public function getPriority(): int {