Score:0

How to bulk change the source language of field labels?

sa flag

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)

Score:0
sa flag

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

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.