File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
user_guide_src/source/outgoing Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -104,12 +104,19 @@ Setting the Current Locale
104104
105105If you want to set the locale directly, you may use
106106``IncomingRequest::setLocale(string $locale) ``.
107- You must set supported locales in **app/Config/App.php **:
107+
108+ Before setting the locale, you must set valid locales. Because any attempt to
109+ set a locale that are not valid will result in
110+ the :ref: `default locale <setting-the-default-locale >` being set.
111+
112+ By default, the valid locales are defined in ``Config\App::$supportedLocales ``
113+ in **app/Config/App.php **:
108114
109115.. literalinclude :: localization/003.php
110116
111- .. note :: Any attempt to set a locale not included in this array will result in
112- the :ref: `default locale <setting-the-default-locale >` being set.
117+ .. note :: Since v4.4.0, ``IncomingRequest::setValidLocales()`` has been added to
118+ set (and reset) valid locales. Use it if you want to change the valid locales
119+ dynamically.
113120
114121Retrieving the Current Locale
115122=============================
You can’t perform that action at this time.
0 commit comments