Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Right now we can set a default language for the field (either via :language or via arguments) but only the last mapping is taken into account.
If we do :
$this->addFieldMapping('field_description', 'package_description') ->arguments(array('language'=>'en')); $this->addFieldMapping('field_description', 'package_description_french') ->arguments(array('language'=>'fr'));
It overwrites the first mapping and gives the following warning message : Package addFieldMapping: field_description was previously mapped, overridden
Note : I'm using Field translation from the i18n module.
Comments
Comment #1
Letharion CreditAttribution: Letharion commentedA potential workaround could be create the actual field setup the prepare method instead, allow I'm guessing migrate could have better support for this than that.
Comment #2
mikeryanIt's tough to see how to work such a feature into the current architecture, about all that can be done for now would be to map one language directly and populate others in prepare().
Comment #3
pifagor