How to change the language of a node and all its fields and all related data? On my multilingual site, I have a content type that is going to be user created. I want to keep it language neutral ('und').

But there already are a couple thousand nodes of that content type and they have English set as their language.

To make them language neutral, I want to write one time update function (hook_update_N) to change the language of the nodes and all their fields from 'en' to 'und'.

I am doing this by making changes directly to database (using db_update) to the language column of node &amp; related field tables. But I am afraid that I may miss something. Can I do this some other way to not miss anything.

I read somewhere that I can user hook_node_presave &amp; node_save to do this but I am not sure how.

Also, how can I make any future nodes' language to be set default as 'und'?
If this is just a one-time conversion, you should be able to do it with Views Bulk Operations (VBO).

Here's one way to do this that doesn't involve writing any code.


Install the VBO module.
Create a new view showing Content of whatever content types you need to convert.  Use the Fields display method.
Add a field Bulk operations: content.
Check Modify entity values and select Language.
Choose Apply.
Save the view (add any other filters if necessary to limit the selection) and go to the created view page.
From the view page, choose the option to select all items on all pages and execute the Modify entity values action.
Choose the language and click next.


If you have an extremely large number of nodes, you may need to play around with the queuing settings so that not everything is executed at once, but I would try doing it in one pass first because hey, if it works, you're done (note: always test on a backup first!)

Source: How can I set the language of nodes in bulk to existing content when making a site multilingual? - please upvote that one if you liked the solution above.

To force the default language to be undefined, in the setting.php file used by your site, add the following lines:

$conf['language_default'] = (object) array(
  'language' =&gt; 'und', 'name' =&gt; '', 'native' =&gt; '',
  'direction' =&gt; 0, 'enabled' =&gt; 1, 'plurals' =&gt; 0, 'formula' =&gt; '',
  'domain' =&gt; '', 'prefix' =&gt; '', 'weight' =&gt; 0, 'javascript' =&gt; ''
);


This will force Drupal to use 'und' as the default language for all new content.