0

I have a French Drupal site that needs to be translated into English and Dutch. My question is only about the translation of the content types fields (label/description/...) which are configuration objects.

When I look at the source language of those fields, it is mostly set to English which is wrong. Approx 20% are set to French, which is fine.

I don't know how it comes but I am there... I would like to change the source language of all those items into French. Is there a way to handle this quickly (I have so many content types each with +/- 30 fields)

0

1 Answer 1

0

Here is the process I used.

1-export all configuration files: drush config-export (see settings.php to get the export directory $config['sync']=..

2-copy all the field.storage.node.field_*.yml and field.field.node.*.field_*.yml into a directory named for example content-fields

3-replace the wrong english langcode from within the content-fields directory using sed: for i in `find *` ; do sed -i -- 's/langcode: en/langcode: fr/g' $i; done

4-import back the corrected files by using drush cim with the partial attribute: drush cim --partial --source=<your path>/content-fields

MAKE SURE TO USE THE PARTIAL ATTRIBUTE TO NOT DELETE MANY CONFIGURATION

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.