1

I want to place a menu block in a template, but ensure it is always displayed in a specific language regardless of whether the content node where it appears is in that language. I do not ever want the block displayed in another language under any circumstances.

In other words, I would like to be able to do something like this, if possible:

{{ drupal_block('menu_block:main', {language: en}) }}

Alternatively, if this can't be achieved with the drupal_block() function, is there some way I can achieve this by implementing a hook in my custom module or theme?

2
  • 1
    If you truly don't want the main menu block to ever appear in another language, it might be better to force that in the block vs telling the node to render the block in english, i.e. make the main menu block always render in english no matter how or where it's rendered. :shrug:
    – sonfd
    Commented Jan 12 at 13:39
  • @sonfd "it might be better to force that in the block." I'd love to. But how? That is what I am asking. "Make the main menu block always render in english." Yes please! But how?
    – arnoldbird
    Commented Jan 17 at 14:06

0

Your Answer

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

Browse other questions tagged or ask your own question.