Using an entity wrapper to change node->body value (with localization) I try to programmatically modify the body of a node using an entity wrapper.
In my Drupal installation I also use Locale module (language for node is 'en', for body it is 'und') and Revisioning module.

Now, I've created a simple code to do this task:

&lt;?php
// in database: field_data_body-&gt;body_value = 'old_value'
$node = node_load(1);

$wrapper = entity_metadata_wrapper('node', $node);

print_r($wrapper-&gt;body-&gt;value-&gt;value());   // prints 'old_value'
$wrapper-&gt;body-&gt;value = 'new_value';
print_r($wrapper-&gt;body-&gt;value-&gt;value());   // still prints 'old_value'

$wrapper-&gt;save();
node_save($node);
?&gt;


yet it seems not to make any changes to the node.

Although, if I've tried to change the title:

$wrapper-&gt;title = 'ABC';


everyting worked fine.

I guess it's the problem related to using localization, but I can't find sufficient documentation on how to achieve what I want.

Could someone tell me how can I put it to work?
Documentation is up to date now.

Examples from drupal.org :

 $wrapper-&gt;author = 0;
 $wrapper-&gt;url = 'dummy';
 $wrapper-&gt;author-&gt;mail = 'foo';
 $wrapper-&gt;author = NULL;
 $wrapper-&gt;author-&gt;set($GLOBALS['user']-&gt;uid);
 $wrapper-&gt;author-&gt;set($GLOBALS['user']);

 // Localization Here
 $wrapper-&gt;body-&gt;set(array('value' =&gt; "&lt;b&gt;The second body.&lt;/b&gt;"));
 $wrapper-&gt;language('de');
 $wrapper-&gt;body-&gt;set(array('value' =&gt; "&lt;b&gt;Der zweite Text.&lt;/b&gt;"));
 $wrapper-&gt;language(LANGUAGE_NONE);
 $wrapper-&gt;set($node);

 $wrapper-&gt;reference-&gt;name-&gt;set('foo');
 $wrapper-&gt;reference-&gt;set($wrapper);
 $wrapper-&gt;save();
 $wrapper-&gt;delete();
 $wrapper-&gt;type-&gt;set('article');
 $wrapper-&gt;author = $user-&gt;uid;
 $wrapper-&gt;{$property}[0] = '2009-10-05';
 $wrapper-&gt;field_image = array('fid' =&gt; $file-&gt;fid);
 $wrapper-&gt;$name-&gt;value();
 $wrapper-&gt;parent[] = $term_parent2;
 $wrapper-&gt;field_tags[1] = $term_parent;
 $wrapper-&gt;field_tags-&gt;set(array(2));
 $wrapper-&gt;field_tags = NULL;
 $wrapper-&gt;$field_name-&gt;set(NULL);
 $wrapper-&gt;field_text[0] = 'the text';
 $wrapper-&gt;field_text[0]-&gt;set(array('value' =&gt; "&lt;b&gt;The second body.&lt;/b&gt;"));
 $wrapper-&gt;field_text2-&gt;summary = 'the summary';
 $wrapper-&gt;field_text2-&gt;value = 'the text';
 $wrapper-&gt;field_file[0] = array('fid' =&gt; $file-&gt;fid, 'display' =&gt; FALSE);
 $wrapper-&gt;field_file[0]-&gt;description = 'foo';
 $wrapper-&gt;field_file[0]-&gt;display = TRUE;
 $wrapper-&gt;field_file[1]-&gt;file = $file;
 $wrapper-&gt;field_file[] = array('description' =&gt; 'test');
 $wrapper-&gt;field_file = NULL;
 $wrapper-&gt;field_image = array('fid' =&gt; $file-&gt;fid);
 $wrapper-&gt;field_image-&gt;alt = 'foo';
 $wrapper-&gt;field_image-&gt;file = $file;
 $wrapper-&gt;field_image = array();


You can follow this link to see full documentation and examples about entity metadata wrappers and localization.

Documentation about entity metadata wrappers on Drupal.org