1

When exporting configuration for a node type with fields with Drupal 8.2, I noticed that translatable: true is set in field.storage.node.my_field.yml, but translatable: false is set in field.field.node.living_word_comment.my_field.yml. my_field is of type Text (plain), i.e. string in the YAML file.

What does it mean for a field to be translatable, while the instance is not? It doesn't make sense to me.

Disclaimer: I'm not sure whether phrases like "field" and "field instance" are still applicable in Drupal 8, or whether that is just 7-speak.

2

Every node field has one storage setting. Here the field is configured how it is stored in the database, field type, single or multi value, or translatable or not. This settings can't be changed after the field is set up and filled with data. It's shared among all content types.

The field can be used in multiple content types. In each content type it can be configured to be translatable. (Option "Users may translate this field"). This setting can be changed any time and without data loss.

If you want the field to be translatable, you need both options set, in the field storage and in the content type where the field is used.

If you use the UI, then you don't have to worry about this, because Drupal sets the storage settings the first time you place a field in a content type.

  • I'm using the UI to make and export fields, which I use as example code for building my own module. Useful to know how this works. Thanks. – rudolfbyker Jan 26 '17 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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