1

My site has a number of content types that have Field Collection fields. All of these field collection fields allow more than one value.

I've marked the content types as translatable, and the field collection fields as well. It does not work though; changes to translations are also visible in the original language.

Field collection is obviously an entity reference of sorts, and adding a new translation does not appear to link the field to a newly created entity, but the same one.

How do I fix this? Is this a configuration issue, or is this a bug?

3 Answers 3

2

For the record, if other people have a hard time figuring how the translation in Field Collection works, here's what I found out:

It does not work.

There is an issue here: https://www.drupal.org/node/2618016 that provides a patch to add support, but does not retroactively add translation support to existing field collections. If your site already has field collections you are SOL - and in my case the whole site becomes non-functional.

I'm now looking into migration towards paragraphs, but not sure how to migrate my data. Will update when I have a good solution.

1

It works if you are using latest Drupal-fc module and define from the creation of the content type as translatable. If you already created fields and then make the CT translatable, it does not work, maybe because its schema does not expect it to be translatable when field was created.

I have successfully edited multilingual values for same node in FC fields, the only thing that still does not work well is that when you delete the translated node, the FC Fields become empty in origin node and viceversa.

1
  • Are you saying (1) The field in the content type should be set translatable (2) The fields inside the field collection should not be set translatable ? Or both should be set translatable ?
    – commonpike
    Mar 31, 2017 at 14:18
0

Both - node's field_collection field and field_collection's inner fields should be translatable. Otherwise you will have same field values for different languages.

If values already exists then you need to manually set language from und to en then duplicate the whole table and set the new language from und to your desired` for example 'hy' => 'Armenian', 'ar' => 'Arabic'.

All your field_collection_item's fields (looks like this - field_collection_item__field_title) and your field_collection_item_revision's fields (looks like this - field_collection_item_revision__field_title) values in that tables should also be duplicated with the same logic.

Your Answer

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

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