Skip to content

Commit

Permalink
Ensure metric value is included in map overlays (#13345)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl authored and mattab committed Aug 28, 2018
1 parent 3b86d01 commit b19d8be
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugins/UserCountryMap/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function visitorMap($fetch = false, $segmentOverride = false)
$view->defaultMetric = 'nb_visits';

// some translations
$view->localeJSON = json_encode(array(
$translations = array(
'nb_visits' => $this->translator->translate('General_NVisits'),
'one_visit' => $this->translator->translate('General_OneVisit'),
'no_visit' => $this->translator->translate('UserCountryMap_NoVisit'),
Expand All @@ -99,7 +99,15 @@ public function visitorMap($fetch = false, $segmentOverride = false)
'no_data' => $this->translator->translate('CoreHome_ThereIsNoDataForThisReport'),
'nb_uniq_visitors' => $this->translator->translate('General_NUniqueVisitors'),
'nb_users' => $this->translator->translate('VisitsSummary_NbUsers'),
));
);

foreach ($translations as &$translation) {
if (false === strpos($translation, '%s')) {
$translation = '%s ' . $translation;
}
}

$view->localeJSON = json_encode($translations);

$view->reqParamsJSON = $this->getEnrichedRequest($params = array(
'period' => $period,
Expand Down

0 comments on commit b19d8be

Please sign in to comment.