From 39b61a4d1053d7b1162def93bcfbe4f61f44d8a9 Mon Sep 17 00:00:00 2001 From: Benjamin Kott Date: Tue, 14 May 2019 23:43:06 +0200 Subject: [PATCH] [BUGFIX] Use LocalizationUtility instead of LanguageService The LanguageService is only indented for backend usage and was incorrectly used in frontend context. The usage in the comment notification was adapted to now use the LocalizationUtility. Fixes: #41 Releases: master, 9.1, 9.0 --- Classes/Notification/CommentAddedNotification.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Classes/Notification/CommentAddedNotification.php b/Classes/Notification/CommentAddedNotification.php index 372c24f9..c447de89 100644 --- a/Classes/Notification/CommentAddedNotification.php +++ b/Classes/Notification/CommentAddedNotification.php @@ -13,8 +13,8 @@ use T3G\AgencyPack\Blog\Domain\Model\Comment; use T3G\AgencyPack\Blog\Domain\Model\Post; use T3G\AgencyPack\Blog\Messaging\MailMessage; -use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Utility\LocalizationUtility; class CommentAddedNotification extends AbstractNotification { @@ -25,7 +25,7 @@ public function getTitle(): string { /** @var Post $post */ $post = $this->data['post']; - return sprintf($this->getLanguageService()->sL('LLL:EXT:blog/Resources/Private/Language/locallang.xlf:emails.CommentAddedNotification.subject'), $post->getTitle()); + return sprintf(LocalizationUtility::translate('emails.CommentAddedNotification.subject', 'blog'), $post->getTitle()); } /** @@ -48,12 +48,4 @@ public function getMessage(): string 'post' => $post ]); } - - /** - * @return LanguageService - */ - protected function getLanguageService(): LanguageService - { - return $GLOBALS['LANG']; - } }