protected function getTranslation($apiMethod, $index)
{
$labels = $this->getLabelTranslations();
foreach ($labels as $action => $translations) {
// Events.getActionFromCategoryId returns translation for Events.getAction
if (strpos($apiMethod, $action) === 0) {
$columnLabel = $translations[$index];
return Piwik::translate($columnLabel);
}
}
throw new \Exception("Translation not found for report {$apiMethod}");
}