diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreHome/Widgets.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/CoreHome/Widgets.php b/plugins/CoreHome/Widgets.php index 68812f0749..17d888bd35 100644 --- a/plugins/CoreHome/Widgets.php +++ b/plugins/CoreHome/Widgets.php @@ -10,12 +10,23 @@ namespace Piwik\Plugins\CoreHome; use Piwik\Common; use Piwik\Piwik; +use Piwik\Translation\Translator; use Piwik\View; class Widgets extends \Piwik\Plugin\Widgets { protected $category = 'Example Widgets'; + /** + * @var Translator + */ + private $translator; + + public function __construct(Translator $translator) + { + $this->translator = $translator; + } + protected function init() { $this->addWidget('CoreHome_SupportPiwik', 'getDonateForm'); @@ -31,7 +42,7 @@ class Widgets extends \Piwik\Plugin\Widgets if (Common::getRequestVar('widget', false) && Piwik::hasUserSuperUserAccess()) { - $view->footerMessage = Piwik::translate('CoreHome_OnlyForSuperUserAccess'); + $view->footerMessage = $this->translator->translate('CoreHome_OnlyForSuperUserAccess'); } return $view->render(); @@ -43,8 +54,8 @@ class Widgets extends \Piwik\Plugin\Widgets public function getPromoVideo() { $view = new View('@CoreHome/getPromoVideo'); - $view->shareText = Piwik::translate('CoreHome_SharePiwikShort'); - $view->shareTextLong = Piwik::translate('CoreHome_SharePiwikLong'); + $view->shareText = $this->translator->translate('CoreHome_SharePiwikShort'); + $view->shareTextLong = $this->translator->translate('CoreHome_SharePiwikLong'); $view->promoVideoUrl = 'https://www.youtube.com/watch?v=OslfF_EH81g'; return $view->render(); |