public function __construct(TranslatorInterface $translator, $defaultGroup, array $groups) { $translatedGroups = []; foreach ($groups as $groupIdentifier) { $translatedGroups[$groupIdentifier] = $translator->trans($groupIdentifier, [], 'ezplatform_fields_groups'); } $this->groups = $translatedGroups; $this->defaultGroup = $defaultGroup; $this->translator = $translator; }