Problem/Motivation

The JSON:API Menu Items module serves a rendered menu tree at /jsonapi/menu_items/{menu}. It is a natural companion for a decoupled multilingual site, but it does not honour this module's langCode / Accept-Language contract. A client that selects a language everywhere else still receives menu link titles in the site's default language: silently, with no language cache variance, and mislabelled by the default Content-language response header.

Steps to reproduce

  1. Configure a site with en (default) and fr, install jsonapi_menu_items, and enable content translation for custom menu links.
  2. Create a menu with a link titled "Home" plus a fr translation "Accueil", and a second link titled "Solo" with no fr translation.
  3. GET /jsonapi/menu_items/{menu}?langCode=fr → both titles come back in English, with Content-language: en and no langCode/Accept-Language cache variance.
  4. GET /jsonapi/menu_items/{menu} with Accept-Language: fr → same result.

Proposed resolution

Apply the module's contract to the companion route, entirely in this module, with the same strict semantics as collections.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lauriii created an issue. See original summary.

  • lauriii committed ca5513ee on 1.0.x
    feat: #3612677 Honour the langCode / Accept-Language contract on the...
lauriii’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.