mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #6629 from open-sausages/pulls/4.0/document-setlocale
Document correct setlocale() use (fixes #6311)
This commit is contained in:
commit
c1ccf354cb
@ -37,6 +37,12 @@ Once we set a locale, all the calls to the translator function will return strin
|
||||
these translations are available. See [unicode.org](http://unicode.org/cldr/data/diff/supplemental/languages_and_territories.html)
|
||||
for a complete listing of available locales.
|
||||
|
||||
The `i18n` logic doesn't set the PHP locale via [setlocale()](http://php.net/setlocale).
|
||||
Localisation methods in SilverStripe rely on explicit locale settings as documented below.
|
||||
If you rely on PHP's built-in localisation such as [strftime()](http://php.net/strftime),
|
||||
please only change locale information selectively. Setting `LC_ALL` or `LC_NUMERIC` will cause issues with SilverStripe
|
||||
operations such as decimal separators in database queries.
|
||||
|
||||
### Getting the locale
|
||||
|
||||
As you set the locale you can also get the current value, just by calling [api:i18n::get_locale()].
|
||||
|
Loading…
Reference in New Issue
Block a user