File tree Expand file tree Collapse file tree
user_guide_src/source/outgoing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ method that will automatically perform :doc:`content negotiation </incoming/cont
5252determine the correct locale to use. The second method allows you to specify a segment in your routes that
5353will be used to set the locale.
5454
55- Should you ever need to set the locale directly you may use `` IncomingRequest::setLocale(string $locale) `` .
55+ Should you ever need to set the locale directly, see ` Setting the Locale `_ .
5656
5757Content Negotiation
5858-------------------
9191
9292.. note :: The ``useSupportedLocalesOnly()`` method can be used since v4.3.0.
9393
94+ Setting the Locale
95+ ==================
96+
97+ If you want to set the locale directly, you may use
98+ ``IncomingRequest::setLocale(string $locale) ``.
99+ You must set supported locales in **app/Config/App.php **:
100+
101+ .. literalinclude :: localization/003.php
102+
103+ Any attempt to set a locale not included in this array will result in the default
104+ locale being set.
105+
94106Retrieving the Current Locale
95107=============================
96108
You can’t perform that action at this time.
0 commit comments