Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

Commit 9fd6ca9

Browse files
committed
Merge branch '1.7' into 1.13
2 parents e086652 + 55e24cc commit 9fd6ca9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Controller/PlatformUIController.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\HttpFoundation\Response;
1717
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
1818
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
19+
use Symfony\Component\Translation\TranslatorInterface;
1920

2021
class PlatformUIController extends Controller
2122
{
@@ -25,23 +26,31 @@ class PlatformUIController extends Controller
2526
/** @var \EzSystems\PlatformUIBundle\Loader\Loader */
2627
private $loader;
2728

29+
/** @var \Symfony\Component\Translation\TranslatorInterface */
30+
private $translator;
31+
2832
/** @var int */
2933
private $comboCacheTtl;
3034

31-
public function __construct(Provider $configAggregator, Loader $loader, $comboCacheTtl = 0)
35+
public function __construct(Provider $configAggregator, Loader $loader, TranslatorInterface $translator, $comboCacheTtl = 0)
3236
{
3337
$this->configAggregator = $configAggregator;
3438
$this->loader = $loader;
39+
$this->translator = $translator;
3540
$this->comboCacheTtl = $comboCacheTtl;
3641
}
3742

3843
/**
3944
* Renders the "shell" page to run the JavaScript application.
4045
*
46+
* @param \Symfony\Component\HttpFoundation\Request $request
47+
*
4148
* @return \Symfony\Component\HttpFoundation\Response
4249
*/
43-
public function shellAction()
50+
public function shellAction(Request $request)
4451
{
52+
$this->translator->setLocale($request->getPreferredLanguage() ?: $request->getDefaultLocale());
53+
4554
return $this->render(
4655
'eZPlatformUIBundle:PlatformUI:shell.html.twig',
4756
['parameters' => $this->configAggregator->getConfig()]

Resources/config/services.yml

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ services:
7676
arguments:
7777
- "@ezsystems.platformui.application_config.aggregator"
7878
- "@ezsystems.platformui.loader.combo_loader"
79+
- "@translator"
7980
- "@=container.getParameter('kernel.debug') ? 0 : parameter('ezsystems.platformui.application_config.combo_loader.cache_ttl')"
8081
parent: ezsystems.platformui.controller.base
8182

0 commit comments

Comments
 (0)