Answer the question
In order to leave comments, you need to log in
How to programmatically create a node with a multilingual site?
Drupal 7
There is such a standard code for creating a node programmatically:
$node = new stdClass();
$node->type = 'journal_number';
node_object_prepare($node);
$node->title = '2016 №1';
$node->language = 'und';
$node->uid = 1;
$node->status = 1;
$node->field_jyear[$node->language][0]['value'] = 2016;
$node->field_jnumber[$node->language][0]['value'] = "1";
if($node = node_submit($node))
node_save($node);
$node->language = 'ru';
$node->language = 'en';
Answer the question
In order to leave comments, you need to log in
Here's the answer:
https://drupal.stackexchange.com/a/36960/7206
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question