1

I have a custom view display plugin which extends from the block plugin. When I add a display on the view, the fields or anything in the display is not translatable (see image below) enter image description here

How can I make the fields in the view display plugin translatable?

1 Answer 1

1

You need to define a schema (where products_block is the plugin ID):

/config/schema/mymodule.views.schema.yml

views.display.products_block:
  type: views.display.block
  label: 'Products block display options'
  mapping:
    ...

This extends views.display.block of /core/modules/views/config/schema/views.display.schema.yml, which extends views_display of /core/modules/views/config/schema/views.data_types.schema.yml

More info Block configuration form values are not translated?

1
  • 2
    Thanks @4k4 , that worked! One small adjustment I made: the file should be named mymodule.views.schema.yml Jul 7, 2021 at 14:59

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.