Merge branch 'exports'

This commit is contained in:
2017-03-07 16:06:10 +01:00
7 changed files with 46 additions and 7 deletions

View File

@@ -24,6 +24,7 @@ use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Translation\TranslatorInterface;
/**
*
@@ -33,6 +34,17 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
class AgeAggregator implements AggregatorInterface,
ExportElementValidatedInterface
{
/**
*
* @var
*/
protected $translator;
public function __construct($translator)
{
$this->translator = $translator;
}
public function addRole()
{
@@ -78,7 +90,7 @@ class AgeAggregator implements AggregatorInterface,
}
if ($value === NULL) {
return "no data";
return $this->translator->trans("without data");
}
return $value;

View File

@@ -172,7 +172,7 @@ class CountryOfBirthAggregator implements AggregatorInterface,
// initialize array and add blank key for null values
$labels[''] = $this->translator->trans('without data');
$labels['_header'] = $this->translator->trans('Nationality');
$labels['_header'] = $this->translator->trans('Country of birth');
foreach($countries as $row) {
$labels[$row['c_countryCode']] = $this->translatableStringHelper->localize($row['c_name']);
}
@@ -189,7 +189,7 @@ class CountryOfBirthAggregator implements AggregatorInterface,
'NA' => $this->translator->trans('North America'),
'OC' => $this->translator->trans('Oceania'),
'' => $this->translator->trans('without data'),
'_header' => $this->translator->trans('Continent')
'_header' => $this->translator->trans('Continent of birth')
);
}