1

I use blocks in a panel with Drupal 8. With view generated blocks there are no problems: The block titles are translated accordingly to the view settings. With custom blocks, it appears to be problematic to get the block title translated. I hoped that these titles would be translatable via the user interface translation but they are not; plus, in the panel settings, I can set the block title, but I cannot translate it.

How can I translate block titles (and maybe block content) of custom blocks in a panel, with Drupal 8?

2 Answers 2

-1

You can override the block.html.twig template and handle the translation of the title directly on the template:

    {{ label|t }}

You may need to confirm the title structure (if is #markup or plain text/string)

-1

Page variants are translatable using config translation at /admin/config/regional/config-translation

0

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.