From c9b92b340798d448cc118ff650325f8d03e051fa Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 11 Apr 2024 17:17:52 +0200 Subject: [PATCH] [FrameworkBundle] Update the enabled_locales description --- reference/configuration/framework.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 25edfe52910..d9299fc4e0f 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -428,9 +428,11 @@ performance a bit: $framework->enabledLocales(['en', 'es']); }; -If some user makes requests with a locale not included in this option, the -application won't display any error because Symfony will display contents using -the fallback locale. +An added bonus of defining the enabled locales is that they are automatically +added as a requirement of the :ref:`special _locale parameter `. +For example, if you define this value as ``['ar', 'he', 'ja', 'zh']``, the +``_locale`` routing parameter will have an ``ar|he|ja|zh`` requirement. If some +user makes requests with a locale not included in this option, they'll see an error. set_content_language_from_locale ................................