Skip to content

Commit 5cea89e

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: [Routing] Document the effect of setting `locale` on a route with locale prefixes
2 parents 798dab4 + e1b69a1 commit 5cea89e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

routing.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,6 +2110,16 @@ with a locale. This can be done by defining a different prefix for each locale
21102110
;
21112111
};
21122112
2113+
.. note::
2114+
2115+
If a route being imported includes the special :ref:`_locale <routing-locale-parameter>`
2116+
parameter in its own definition, Symfony will only import it for that locale
2117+
and not for the other configured locale prefixes.
2118+
2119+
E.g. if a route contains ``locale: 'en'`` in its definition and it's being
2120+
imported with ``en`` (prefix: empty) and ``nl`` (prefix: ``/nl``) locales,
2121+
that route will be available only in ``en`` locale and not in ``nl``.
2122+
21132123
Another common requirement is to host the website on a different domain
21142124
according to the locale. This can be done by defining a different host for each
21152125
locale.

0 commit comments

Comments
 (0)