user scope/job filters: improve translation in csv

This commit is contained in:
2022-07-20 11:24:13 +02:00
parent ff8a32a321
commit 7f1dadc136
3 changed files with 30 additions and 6 deletions

View File

@@ -46,8 +46,20 @@ class UserJobFilter implements FilterInterface
public function describeAction($data, $format = 'string')
{
// to complete..
return ['Filtered by user jobs'];
$jobs = [];
foreach ($data['accepted_userjob'] as $j) {
if ('null' === $j) {
$jobs[] = $this->translator->trans('Not given');
} else {
$jobs[] = $this->translatableStringHelper->localize($j->getLabel());
}
}
return [
'Filtered by user jobs: only %jobs%',
['%jobs%' => implode(', ', $jobs)],
];
}
public function addRole()

View File

@@ -45,8 +45,20 @@ class UserScopeFilter implements FilterInterface
public function describeAction($data, $format = 'string')
{
// to complete..
return ['Filtered by user scopes'];
$scopes = [];
foreach ($data['accepted_userscope'] as $s) {
if ('null' === $s) {
$scopes[] = $this->translator->trans('Not given');
} else {
$scopes[] = $this->translatableStringHelper->localize($s->getName());
}
}
return [
'Filtered by user scopes: only %scopes%',
['%scopes%' => implode(', ', $scopes)],
];
}
public function addRole()