diff options
author | Nathan Sollenberger <nsollenberger@gmail.com> | 2015-05-12 06:03:06 +0300 |
---|---|---|
committer | Nathan Sollenberger <nsollenberger@gmail.com> | 2015-05-12 06:03:06 +0300 |
commit | 27c59061eaf9a76d4ab319a2ca357aab379f6ed4 (patch) | |
tree | 82148115764d9c0948e9be99eddd7278a1944350 /plugins/Goals/Controller.php | |
parent | 179ed7eedd8d8ba092122a336bbe91b9eccb1099 (diff) |
Add TranslationHelper to Goals Plugin, alter English text files for Goal category names
Diffstat (limited to 'plugins/Goals/Controller.php')
-rw-r--r-- | plugins/Goals/Controller.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/Goals/Controller.php b/plugins/Goals/Controller.php index f7775262a3..493dd1b375 100644 --- a/plugins/Goals/Controller.php +++ b/plugins/Goals/Controller.php @@ -48,6 +48,11 @@ class Controller extends \Piwik\Plugin\Controller */ private $translator; + /** + * @var TranslationHelper + */ + private $translationHelper; + private function formatConversionRate($conversionRate, $columnName = 'conversion_rate') { if ($conversionRate instanceof DataTable) { @@ -65,11 +70,12 @@ class Controller extends \Piwik\Plugin\Controller return $conversionRate; } - public function __construct(Translator $translator) + public function __construct(Translator $translator, TranslationHelper $translationHelper) { parent::__construct(); $this->translator = $translator; + $this->translationHelper = $translationHelper; $this->idSite = Common::getRequestVar('idSite', null, 'int'); $this->goals = API::getInstance()->getGoals($this->idSite); @@ -451,9 +457,9 @@ class Controller extends \Piwik\Plugin\Controller $allReports = Goals::getReportsWithGoalMetrics(); foreach ($allReports as $category => $reports) { if ($ecommerce) { - $categoryText = $this->translator->translate('Ecommerce_ViewSalesBy', $category); + $categoryText = $this->translationHelper->getTranslationForGoalMetricCategoryText('Ecommerce', $category); } else { - $categoryText = $this->translator->translate('Goals_ViewGoalsBy', $category); + $categoryText = $this->translationHelper->getTranslationForGoalMetricCategoryText('Goals', $category); } foreach ($reports as $report) { |