Menu block displays wrong language when only using content translation

Created on 25 March 2019, over 5 years ago
Updated 9 February 2023, over 1 year ago

Background:

The website we are building will support two different languages, and all the content is being translated so there are versions for both.

However, we have not turned on interface translation, since we want the drupal interface to remain in English, as that is what the site editors are most comfortable using.

The Problem:

When switching to the alternate language of a page, the menu blocks items are remaining in English, and don't change unless you clear the render cache.

The Cause:

Despite the menu items being content that is translated using content translation, the rendered menu blocks are being stored in the cache using the interface language instead of the content language, such as:

cid: entity_view:block:site_name_main_menu:[languages:language_interface]=en:[route.menu_active_trails:main]=menu_trail.main|menu_link_content:8c16c3a4-f165-4ea4-b2b4-07a1cee8e592|:[theme]=site_name:[user.perm-AjQCijrXHvxvgiuYXJCT4T4GgXa1tNWosi6GEgeN5Y

The Solution?

Could we switch menu blocks over to using the content language instead of the interface language? Or should we store both, so a rendered copy of the block is stored for each interface/content language combination?

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
Language systemΒ  β†’

Last updated about 23 hours ago

  • Maintained by
  • πŸ‡©πŸ‡ͺGermany @sun
Created by

πŸ‡ΊπŸ‡ΈUnited States mikemccaffrey

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024