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

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sollenberger <nsollenberger@gmail.com>2015-05-12 06:03:06 +0300
committerNathan Sollenberger <nsollenberger@gmail.com>2015-05-12 06:03:06 +0300
commit27c59061eaf9a76d4ab319a2ca357aab379f6ed4 (patch)
tree82148115764d9c0948e9be99eddd7278a1944350 /plugins/Goals/Controller.php
parent179ed7eedd8d8ba092122a336bbe91b9eccb1099 (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.php12
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) {