mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
docs: improve description for "Locale Detection"
This commit is contained in:
parent
5f318453a6
commit
ace19636d2
@ -24,9 +24,6 @@ supported language (locale)::
|
||||
fr/
|
||||
App.php
|
||||
|
||||
.. important:: Locale detection only works for web-based requests that use the IncomingRequest class.
|
||||
Command-line requests will not have these features.
|
||||
|
||||
Configuring the Locale
|
||||
======================
|
||||
|
||||
@ -52,10 +49,13 @@ directory existed at the **app/Language/en-US** directory then that would be use
|
||||
Locale Detection
|
||||
================
|
||||
|
||||
There are two methods supported to detect the correct locale during the request. The first is a "set and forget"
|
||||
method that will automatically perform :doc:`content negotiation </incoming/content_negotiation>` for you to
|
||||
determine the correct locale to use. The second method allows you to specify a segment in your routes that
|
||||
will be used to set the locale.
|
||||
.. important:: Locale detection only works for web-based requests that use the IncomingRequest class.
|
||||
Command-line requests will not have these features.
|
||||
|
||||
There are two methods supported to detect the correct locale during the request.
|
||||
|
||||
1. `Content Negotiation`_: The first is a "set and forget" method that will automatically perform :doc:`content negotiation </incoming/content_negotiation>` for you to determine the correct locale to use.
|
||||
2. `In Routes`_: The second method allows you to specify a segment in your routes that will be used to set the locale.
|
||||
|
||||
Should you ever need to set the locale directly, see `Setting the Current Locale`_.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user