Skip to content

Commit 9ea91c6

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: [Routing] Document the effect of setting `locale` on a route with locale prefixes
2 parents 2bd8243 + 6d7ada0 commit 9ea91c6

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
@@ -2072,6 +2072,16 @@ with a locale. This can be done by defining a different prefix for each locale
20722072
;
20732073
};
20742074
2075+
.. note::
2076+
2077+
If a route being imported includes the special :ref:`_locale <routing-locale-parameter>`
2078+
parameter in its own definition, Symfony will only import it for that locale
2079+
and not for the other configured locale prefixes.
2080+
2081+
E.g. if a route contains ``locale: 'en'`` in its definition and it's being
2082+
imported with ``en`` (prefix: empty) and ``nl`` (prefix: ``/nl``) locales,
2083+
that route will be available only in ``en`` locale and not in ``nl``.
2084+
20752085
Another common requirement is to host the website on a different domain
20762086
according to the locale. This can be done by defining a different host for each
20772087
locale.

0 commit comments

Comments
 (0)