protected function synchronizeDatabaseTranslations(array $messages, LocaleInterface $locale)
{
$this->getDoctrineHelper()->truncateTable('WellCommerce\\Bundle\\DictionaryBundle\\Entity\\Dictionary');
$em = $this->getDoctrineHelper()->getEntityManager();
foreach ($messages as $identifier => $translation) {
$dictionary = $this->factory->create();
$dictionary->setIdentifier($identifier);
$dictionary->translate($locale->getCode())->setValue($translation);
$dictionary->mergeNewTranslations();
$em->persist($dictionary);
}
}