bar
5/4/2015 - 11:36 AM

translation. field translations

translation. field translations

global $user;
$query = new EntityFieldQuery();

$query->entityCondition('entity_type', 'node')
           ->entityCondition('bundle', 'news');

$results = $query->execute();

foreach ($results['node'] as $record) {
            $id = $record->nid;
             $entity = entity_load_single('node', $id);
             $wrapper = entity_metadata_wrapper('node', $entity);
             $wrapper->language('it')->field_news_title->set($entity->title);
             entity_save('node', $entity);
}