2

The question is fairly straight forward. I have several config entities with various fields.

I haven't found a way to translate config entity fields in the Drupal 8 documentation(or maybe I haven't looked hard enough, both are a strong possibility).

5

You need a schema of the type config_entity.

See for example the one for the node type config entity:

/node/config/schema/node.schema.yml:

node.type.*:
  type: config_entity
  label: 'Content type'
  mapping:
    name:
      type: label
      label: 'Name'
    type:
      type: string
      label: 'Machine-readable name'
    description:
      type: text
      label: 'Description'
    help:
      type: text
      label: 'Explanation or submission guidelines'
    new_revision:
      type: boolean
      label: 'Whether a new revision should be created by default'
    preview_mode:
      type: integer
      label: 'Preview before submitting'
    display_submitted:
      type: boolean
      label: 'Display setting for author and date Submitted by post information'

Choose for fields you want to make translatable the types label and text. See also D8 How to create custom configurational form translatable?

1
  • 1
    This is a little more complicate than I imagined. Either way, it's seem this is the way. Thanks. – Andrew Sep 15 '17 at 13:43

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.