92
92
Setting the Current Locale
93
93
==========================
94
94
95
- If you want to set the locale directly, you may use
96
- ``IncomingRequest::setLocale(string $locale) ``.
95
+ IncomingRequest Locale
96
+ ----------------------
97
+
98
+ If you want to set the locale directly, you may use the
99
+ ``IncomingRequest::setLocale() `` method.
97
100
98
101
Before setting the locale, you must set valid locales. Because any attempt to
99
102
set a locale that are not valid will result in
@@ -108,6 +111,15 @@ in **app/Config/App.php**:
108
111
set (and reset) valid locales. Use it if you want to change the valid locales
109
112
dynamically.
110
113
114
+ Language Locale
115
+ ---------------
116
+
117
+ The ``Language `` class used in the :php:func: `lang() ` function also has the current
118
+ locale. This is set to the ``IncommingRequest `` locale during instantiating.
119
+
120
+ If you want to change the locale after instantiating the language class, use the
121
+ ``Language::setLocale() `` method.
122
+
111
123
Retrieving the Current Locale
112
124
=============================
113
125
@@ -218,10 +230,12 @@ Specifying Locale
218
230
-----------------
219
231
220
232
To specify a different locale to be used when replacing parameters, you can pass the locale in as the
221
- third parameter to the `` lang() ` ` function.
233
+ third parameter to the :php:func: ` lang() ` function.
222
234
223
235
.. literalinclude :: localization/016.php
224
236
237
+ If you want to change the current locale, see `Language Locale `_.
238
+
225
239
Nested Arrays
226
240
-------------
227
241
0 commit comments