您需要两个迁移任务,即迁移文件夹中的yml文件:
migrate.migration.external_translated_test_node.yml
migrate.migration.external_translated_test_node_translation.yml
然后,在插件(MigrateExternalTranslatedTestSource.php)中,您需要将.csv(在中initializeIterator()
)读入导入数组的结构中:
/**
* The data to import.
*
* @var array
*/
protected $import = [
['name' => 'cat', 'title' => 'Cat', 'lang' => 'English'],
['name' => 'cat', 'title' => 'Chat', 'lang' => 'French'],
['name' => 'cat', 'title' => 'Gato', 'lang' => 'Spanish'],
['name' => 'dog', 'title' => 'Dog', 'lang' => 'English'],
['name' => 'dog', 'title' => 'Chien', 'lang' => 'French'],
['name' => 'monkey', 'title' => 'Monkey', 'lang' => 'English'],
];
I was able for the moment to migrate the english content
这是我的多语言新手Q /建议,您难道不能假装您只是用英语创建了D8网站,现在您想使其成为多语言网站吗?