Closed (works as designed)
Project:
Migrate
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
31 Jul 2014 at 14:48 UTC
Updated:
2 Aug 2016 at 21:48 UTC
Jump to comment: Most recent
Comments
Comment #1
rob_johnston commentedI would make 2 migrations, one for English and one for French. I would also set the French to be dependent on the English and then write a postImport() function on the French that makes translation sets. If anybody follows another pattern then I'd love to hear of it.
Comment #2
mikeryanWhat would you like the result of the migration to be? If you want two nodes, an English node and a French node related in a translation set, then @rob_johnston's approach would be correct. If instead you want one node where the name field has an English value and a French value, it's a little trickier - you need to do some manipulation in prepareRow(), like:
I haven't done multilingual migration like this myself, so let me know if that doesn't work.
Comment #3
mikeryanComment #4
rob_johnston commentedWell as a last word, I can confirm that works, but you'll need something like this too:
Comment #5
digitaldonkey commented@mikeryanIs this the way it should work in D8 too?
Comment #6
digitaldonkey commentedIn Drupal 8 it seems the multilingual import is not really working yet as designed.
I ended up implementing the MigrateEvents::POST_ROW_SAVE Event.
Maybe someone will find a way to multilingual migrations using the following:
donkeymedia_migrate/donkeymedia_migrate.services.yml
donkeymedia_migrate/src/EventSubscriber/DonkeymediaMigratePostSave.php
I know this is the kind of the wrong place to publish this, but repeatedly ended up here searching for solutions.
Comment #7
digitaldonkey commentedComment #8
star-szrComment #9
mpp commented@digitaldonkey have you found a better way of doing it for Drupal 8?
edit: This is how core handles multilingual migrations for Drupal 8: https://www.drupal.org/node/2225775
Comment #10
caspervoogt commented@digitaldonkey what version of Drupal core did your code work with? I tried it on 8.1.7-dev and it caused some fatal errors, so then I tried with 8.0.0 and 8.0.1 and also no luck.