create multilingual node programmatically i'm trying to create a multilingual node using a php script.

I'm doing this:

 $node = new stdClass();
 $node-&gt;title = "Test ".mktime();
 $node-&gt;type = "job";
 $node-&gt;language = 'de'; // Or e.g. 'en' if locale is enabled
 $node-&gt;uid = $user-&gt;uid; 
 $node-&gt;status = 1; //(1 or 0): published or not
 $node-&gt;promote = 0; //(1 or 0): promoted to front page
 $node-&gt;comment = 1; //2 = comments on, 1 = comments off
 $node-&gt;path = array('alias' =&gt; 'das-ist-ein-test-'.mktime());
 $node-&gt;body[$node-&gt;language][0]['value']   = "Body Body Body";
 $node-&gt;body[$node-&gt;language] = text_summary("Body Body Body");
 $node-&gt;body[$node-&gt;language]  = 'filtered_html';
 node_save($node);


As long as i set $node->language to 'und' everything is working fine.
But as soon as I set the language to 'de' or 'en' (both languages are activated in my Drupal installation) the body text doesn't get saved.

So my question is: can anybody provide me with a working example of how to store a multlingual node (de,en) into Drupal using program code.

Thank you
It depends on is your body field translatable or not. Please, look at this explanation about translatable fields: https://drupal.stackexchange.com/a/31639/2466  

$node_lang = 'ru'; // I am a Russian girl

$node = new stdClass();
$node-&gt;title = "Test ".mktime();
$node-&gt;type = 'article'; // Your type
$node-&gt;language = $node_lang;
$node-&gt;uid = 1; 
$node-&gt;status = 1;

// Get proper langcode
$body_field_info = field_info_field('body');
if (field_is_translatable('node', $body_field_info)) {
  $body_language = field_valid_language($node_lang);
} else {
  $body_language = LANGUAGE_NONE;
}

// Some lorem ipsum.
// You can add custom summary:
// $node-&gt;body[$body_language][0]['summary'] = 'Summary';
$node-&gt;body[$body_language][0]['value']   = 'Lorem monotonectally iterate resource-leveling innovation before timely core competencies. Globally coordinate sustainable strategic theme areas and intermandated infomediaries. Monotonectally brand customer directed solutions and high-quality bandwidth.';

node_save($node);


There is an issue for Drupal 8 to make Field Language API more usable.