Skip to content

Commit 3622fa8

Browse files
committed
docs: add about missing Language locale
1 parent 4f2de95 commit 3622fa8

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

user_guide_src/source/outgoing/localization.rst

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ file:
9292
Setting the Current Locale
9393
==========================
9494

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.
97100

98101
Before setting the locale, you must set valid locales. Because any attempt to
99102
set a locale that are not valid will result in
@@ -108,6 +111,15 @@ in **app/Config/App.php**:
108111
set (and reset) valid locales. Use it if you want to change the valid locales
109112
dynamically.
110113

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+
111123
Retrieving the Current Locale
112124
=============================
113125

@@ -218,10 +230,12 @@ Specifying Locale
218230
-----------------
219231

220232
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.
222234

223235
.. literalinclude:: localization/016.php
224236

237+
If you want to change the current locale, see `Language Locale`_.
238+
225239
Nested Arrays
226240
-------------
227241

0 commit comments

Comments
 (0)