php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72591 [RU] Wrong description for locale setting in function setlocale
Submitted: 2016-07-13 11:15 UTC Modified: 2016-11-06 18:44 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: mr dot vstas at gmail dot com Assigned: rjhdby (profile)
Status: Closed Package: Translation problem
PHP Version: 5.5.37 OS: Ubuntu 14.04 LTS
Private report: No CVE-ID: None
 [2016-07-13 11:15 UTC] mr dot vstas at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.setlocale

Incorrect translate in cyrillic.

So it looks at the Russian:
------------------------------------------
"Если в качестве locale передан NULL или "0", локаль изменена не будет, а будет возвращено текущее значение.
------------------------------------------

But in English.
------------------------------------------
If locale is NULL or the empty string "", the locale names will be set from the values of environment variables with the same names as the above categories, or from "LANG".

If locale is "0", the locale setting is not affected, only the current setting is returned.
------------------------------------------

This means that English is written for a different behavior for locale setting with "0" or with NULL.





---


Test script:
---------------
// default locale ru_RU.UTF8

// change default locale to another. It's work correct.
var_dump(setlocale(LC_ALL,"ru_RU.CP1251"));

// return current locale. It's work correct and return ru_RU.CP1251
var_dump(setlocale(LC_ALL,"0"));

// the resulting behavior is not consistent 
// with the description in the Russian translation of documentation
var_dump(setlocale(LC_ALL,NULL));



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-13 12:57 UTC] cmb@php.net
-Summary: Wrong description for locale setting in function setlocale +Summary: [RU] Wrong description for locale setting in function setlocale
 [2016-11-06 18:44 UTC] rjhdby@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: rjhdby
 [2016-11-06 18:44 UTC] rjhdby@php.net
already updated
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 12:01:27 2024 UTC