0

I have a site that has been duplicated from an english site and has been translated into Italian.

I installed Italian as a language and have set it as default. However, all of the nodes created in the cloned site are still set to "english".

How can I bulk update the language for all content, either programmatically or directly with SQL?

1 Answer 1

0

Load the nodes entities and set its langcode column

For example:

$w_node = entity_load('node', $nid);
$w_node->set('langcode', $data_langcode);
$w_node->save();

To do it in bulk, i guesing that you should create a new action to be available in the defaults bluk operations for the admin/content view

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.