Skip to content

Commit

Permalink
made list of locales to be formed from config
Browse files Browse the repository at this point in the history
  • Loading branch information
einorler committed Mar 16, 2016
1 parent 704d398 commit 7b700df
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Controller/ListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,12 @@ public function listAction(Request $request)
*/
private function buildLocalesList($filter)
{
$search = $this->repository->createSearch();

$localeAgg = new TermsAggregation('locale_agg');
$localeAgg->setField('messages.locale');
$search->addAggregation($localeAgg);
$result = $this->repository->execute($search, Result::RESULTS_RAW);
$locales = $this->container->getParameter('ongr_translations.managed_locales');
$list = [];

foreach ($result['aggregations']['locale_agg']['buckets'] as $value) {
$list[$value['key']] = true;
foreach ($locales as $locale) {
$list[$locale] = true;
}
ksort($list);

$activeLocales = [];

if ($filter->getState()->isActive()) {
Expand Down

0 comments on commit 7b700df

Please sign in to comment.