diff --git a/lib/RoadizCoreBundle/src/Api/Controller/GetWebResponseByPathController.php b/lib/RoadizCoreBundle/src/Api/Controller/GetWebResponseByPathController.php index 2e924a4f..b6434889 100644 --- a/lib/RoadizCoreBundle/src/Api/Controller/GetWebResponseByPathController.php +++ b/lib/RoadizCoreBundle/src/Api/Controller/GetWebResponseByPathController.php @@ -134,6 +134,15 @@ protected function normalizeResourcePath(?Request $request, string $path): Persi $this->addResourceToCacheTags($request, $resource); + // Set translation and locale to be used in Request context + if (null !== $resourceInfo->getTranslation()) { + $request->attributes->set('_translation', $resourceInfo->getTranslation()); + } + + if (null !== $resourceInfo->getLocale()) { + $request->attributes->set('_locale', $resourceInfo->getLocale()); + } + /* * Or plain entity */