Hi,

I have a running German language site setup which I am planning use for setting up new site for new country (let say Spain). New site will be a separate multilingual site in Spanish and English. Sorry because of some limitation I don't want to make existing site multilingual with Spanish and English version.
There will be less content changes in old to new site, so I am trying to find a module which can perform bulk update so that all the German language content (nodes preferably) can be copied into new two language (Spanish and English) translations (as is not actual translation needed) and later I can simply delete German language and keep only desired two languages.

Thanks in advance for your help and suggestion.

Comments

rupesh_jagtap created an issue. See original summary.

plach’s picture

Status: Active » Fixed

Entity Translation doesn't support anything like that out of the box, sorry.

rupesh_jagtap’s picture

Status: Fixed » Active

Reopening it for some time. I would appreciate, if anybody have idea about any other module to achieve it.

stefanos.petrakis@gmail.com’s picture

Status: Active » Fixed

This issue should not be open, or even be part of this issue queue. The Entity Translation module does not have anything to do with your use case, which has to do with cloning translated data. So, I am going to set this to fixed again.

And also going to hint towards this module (https://www.drupal.org/project/translation_clone) that could help you copy your translated content into new translations. After you are done, you can simply deactivate the German language. ;)

Good luck!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

tbisciglia’s picture

Greetings! I was racking my brain over this problem in Drupal 8. Here's how I finally got it done, This code copies title, body, all fields, and the pathauto setting. I'm sure there's room for improvement here as some meta fields probably need to get processed too. But this should get you started!

// This assumes you have a $node variable that contains the node translation you're starting with
$node_trans = $node->addTranslation('en-au'); // sample using Australian English
$node_trans->setTitle($node->getTitle());
$node_trans_fields = $node->getTranslatableFields();
foreach ($node_trans_fields as $name => $field) {
  if (substr($name, 0, 6) == 'field_' || in_array($name, ['body', 'path'])) {
    $node_trans->set($name, $field->getValue());
  }
}
try {
  $node->save();
}
catch (\Exception $error) {
  $add_status .= 'ERROR saving ';
}