-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCustomDimensionLabel.php
42 lines (34 loc) · 1.11 KB
/
CustomDimensionLabel.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* InnoCraft - the company of the makers of Matomo Analytics, the free/libre analytics platform
*
* @link https://www.innocraft.com
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\CustomTranslations\TranslationTypes;
use Piwik\DataTable\DataTableInterface;
use Piwik\Piwik;
class CustomDimensionLabel extends TranslationType
{
public const ID = 'customDimensionLabel';
public function getName()
{
return Piwik::translate('CustomTranslations_CustomDimensionValue');
}
public function getDescription()
{
return Piwik::translate('CustomTranslations_CustomDimensionValueDescription');
}
public function getTranslationKeys()
{
return [];
}
public function translate($returnedValue, $method, $extraInfo)
{
if ($method === 'CustomDimensions.getCustomDimension' && $returnedValue instanceof DataTableInterface) {
$renameMap = array('all' => $this->getTranslations());
$this->translateReportLabel($returnedValue, $renameMap);
}
return $returnedValue;
}
}