Skip to content

Commit 75c3fd8

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: [FrameworkBundle] Update the enabled_locales description
2 parents 86c9fe2 + ef7b670 commit 75c3fd8

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
@@ -460,9 +460,11 @@ performance a bit:
460460
$framework->enabledLocales(['en', 'es']);
461461
};
462462
463-
If some user makes requests with a locale not included in this option, the
464-
application won't display any error because Symfony will display contents using
465-
the fallback locale.
463+
An added bonus of defining the enabled locales is that they are automatically
464+
added as a requirement of the :ref:`special _locale parameter <routing-locale-parameter>`.
465+
For example, if you define this value as ``['ar', 'he', 'ja', 'zh']``, the
466+
``_locale`` routing parameter will have an ``ar|he|ja|zh`` requirement. If some
467+
user makes requests with a locale not included in this option, they'll see a 404 error.
466468

467469
set_content_language_from_locale
468470
................................

0 commit comments

Comments
 (0)