Skip to content

Commit 2edd26f

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: [FrameworkBundle] Update the enabled_locales description
2 parents 84610d6 + 5a35616 commit 2edd26f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

reference/configuration/framework.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,11 @@ performance a bit:
409409
$framework->enabledLocales(['en', 'es']);
410410
};
411411
412-
If some user makes requests with a locale not included in this option, the
413-
application won't display any error because Symfony will display contents using
414-
the fallback locale.
412+
An added bonus of defining the enabled locales is that they are automatically
413+
added as a requirement of the :ref:`special _locale parameter <routing-locale-parameter>`.
414+
For example, if you define this value as ``['ar', 'he', 'ja', 'zh']``, the
415+
``_locale`` routing parameter will have an ``ar|he|ja|zh`` requirement. If some
416+
user makes requests with a locale not included in this option, they'll see a 404 error.
415417

416418
set_content_language_from_locale
417419
................................

0 commit comments

Comments
 (0)