protected function execute(InputInterface $input, OutputInterface $output)
 {
     $dialog = $this->getHelperSet()->get('dialog');
     if (!$dialog->askConfirmation($output, '<question>Confirmez-vous l\'import des traductions ? (Y/N)</question>', false)) {
         return;
     }
     $translate = $this->getContainer()->get('ter_translate.translate');
     foreach ($translate->getLocales() as $locale) {
         $messages = $this->getContainer()->get('translator')->getCatalogue($locale);
         foreach ($messages->all() as $domain => $values) {
             $repoDomain = $this->getContainer()->get('doctrine')->getRepository('TerTranslateBundle:Domain');
             $addDomain = $repoDomain->findOneByCode($domain);
             if (!$addDomain) {
                 $addDomain = new Domain();
                 $addDomain->setName('[BACK] Domain System - ' . $domain)->setCode($domain)->setDescription('Domain system import');
                 $this->getContainer()->get('doctrine')->getManager()->persist($addDomain);
                 $output->writeln('<fg=green>Import du domaine ' . $domain . '</fg=green>');
             }
             foreach ($values as $key => $value) {
                 $wording = $this->getContainer()->get('doctrine')->getRepository('TerTranslateBundle:Wording')->findOneByCode($key);
                 if (!$wording) {
                     $wording = new Wording();
                     $wording->setCode($key);
                     $wording->setDomain($addDomain);
                     $output->writeln('<fg=blue>Import du wording ' . $key . '</fg=blue>');
                 }
                 $wordingExists = $this->getContainer()->get('doctrine')->getRepository('TerTranslateBundle:WordingTranslation')->findOneBy(array('locale' => $locale, 'translatable' => $wording));
                 if (!$wordingExists) {
                     $trans = (new WordingTranslation())->setLocale($locale)->setValue($value)->setTranslatable($wording);
                     $wording->addTranslation($trans);
                     $output->writeln('<fg=yellow>Import de la traduction [' . $locale . ' - ' . $key . ']</fg=yellow>');
                 }
                 $this->getContainer()->get('doctrine')->getManager()->persist($wording);
             }
         }
         $this->getContainer()->get('doctrine')->getManager()->flush();
     }
 }