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
- Configure a site with en (default) and fr, install jsonapi_menu_items, and enable content translation for custom menu links.
- Create a menu with a link titled "Home" plus a fr translation "Accueil", and a second link titled "Solo" with no fr translation.
- GET
/jsonapi/menu_items/{menu}?langCode=fr→ both titles come back in English, with Content-language: en and no langCode/Accept-Language cache variance. - 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.
Issue fork jsonapi_multilingual-3612677
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
Comment #4
lauriii