Problem/Motivation
I'm not sure if this feature will be popular or if it would be a specific use case for me, but currently, the subrequests module will only use the master request langcode, but this might not be optimal when using it with the 'decoupled router' module. In my use case, the first subrequest would be for the 'decoupled router' module to translate the path, but I still don't know the language of the target entity, I want to let my second subrequest to handle the language by itself.
Steps to reproduce
My website default language is English, but I did a subrequest with these parameters:
[
{
"requestId": "req-1",
"uri": "/router/translate-path?path=/ar/some-arabic-content",
"action": "view"
},
{
"requestId": "req-2",
"waitFor": [
"req-1"
],
"uri": "{{req-1.body@$.jsonapi.individual}}",
"action": "view"
}
]
I expect the second subrequest to fetch me the Arabic content, but it will fetch me the English one since the default language is English.
Proposed resolution
Maybe we should reset the language manager for each subrequest? I'm not sure exactly if this is the best solution. I will assign this issue as a feature request instead of a bugfix since this might be an intended functionality.