protected function getDatabaseTranslations(LocaleInterface $locale) { $messages = []; $collection = $this->repository->matching(new Criteria()); $collection->map(function (DictionaryInterface $dictionary) use($locale, &$messages) { $messages[$dictionary->getIdentifier()] = $dictionary->translate($locale->getCode())->getValue(); }); return $messages; }