Commit 4d47830 1 parent 0a2c1f6 commit 4d47830 Copy full SHA for 4d47830
File tree 5 files changed +15
-7
lines changed
5 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 10
10
<localizations >
11
11
<!-- See: http://docs.sulu.io/en/latest/book/localization.html how to add new localizations -->
12
12
<localization language =" en" default =" true" />
13
+ <localization language =" de" />
14
+ <localization language =" fr" />
13
15
</localizations >
14
16
15
17
<default-templates >
48
50
<environments >
49
51
<environment type =" prod" >
50
52
<urls >
51
- <url language = " en " >{host}</url >
53
+ <url >{host}/{localization }</url >
52
54
</urls >
53
55
</environment >
54
56
<environment type =" stage" >
55
57
<urls >
56
- <url language = " en " >{host}</url >
58
+ <url >{host}/{localization }</url >
57
59
</urls >
58
60
</environment >
59
61
<environment type =" test" >
60
62
<urls >
61
- <url language = " en " >{host}</url >
63
+ <url >{host}/{localization }</url >
62
64
</urls >
63
65
</environment >
64
66
<environment type =" dev" >
65
67
<urls >
66
- <url language = " en " >{host}</url >
68
+ <url >{host}/{localization }</url >
67
69
</urls >
68
70
</environment >
69
71
</environments >
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public function __construct(
21
21
) {
22
22
}
23
23
24
- #[Route('/event/{id} ' , name: 'app.event ' )]
24
+ #[Route('/{_locale}/ event/{id} ' , name: 'app.event ' )]
25
25
public function indexAction (int $ id , Request $ request ): Response
26
26
{
27
27
$ event = $ this ->eventRepository ->findById ($ id , $ request ->getLocale ());
Original file line number Diff line number Diff line change 41
41
</li >
42
42
{% endfor %}
43
43
</ul >
44
+
45
+ <div class =" navbar-nav" >
46
+ {% for localization in localizations %}
47
+ <a class =" nav-link" href =" {{ localization .url }}" >{{ localization .locale }}</a >
48
+ {% endfor %}
49
+ </div >
44
50
</div >
45
51
</nav >
46
52
</div >
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public function testIndexAction(): void
26
26
{
27
27
$ event = $ this ->createEvent ('Sulu is awesome ' , 'en ' );
28
28
29
- $ crawler = $ this ->client ->request ('GET ' , '/event/ ' . $ event ->getId ());
29
+ $ crawler = $ this ->client ->request ('GET ' , '/en/ event/ ' . $ event ->getId ());
30
30
31
31
$ response = $ this ->client ->getResponse ();
32
32
$ this ->assertInstanceOf (Response::class, $ response );
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public function testHomepage(): void
47
47
],
48
48
);
49
49
50
- $ crawler = $ this ->client ->request (Request::METHOD_GET , '/homepage ' );
50
+ $ crawler = $ this ->client ->request (Request::METHOD_GET , '/en/ homepage ' );
51
51
52
52
$ response = $ this ->client ->getResponse ();
53
53
$ this ->assertInstanceOf (Response::class, $ response );
You can’t perform that action at this time.
0 commit comments