Bug #66265 [Asn]: gettext is not working anymore
| From: | roeycohen at gmail dot com | Date: | Thu, 12 Dec 2013 11:10:05 +0000 |
| Subject: | Bug #66265 [Asn]: gettext is not working anymore | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183255@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66265&edit=1
ID: 66265
User updated by: roeycohen at gmail dot com
Reported by: roeycohen at gmail dot com
Summary: gettext is not working anymore
Status: Assigned
Type: Bug
Package: Gettext related
Operating System: windows
PHP Version: 5.5.6
Assigned To: ab
Block user comment: N
Private report: N
New Comment:
ok, i found something,
if i change the folder en_US to he_IL and also use these lines instead of the original ones:
putenv("LC_ALL=he_IL");
setlocale(LC_ALL, 'he_IL');
and restart the server then everything is working fine...
i didn't had this problem in version 5.4.8 :(
Previous Comments:
------------------------------------------------------------------------
[2013-12-12 10:42:54] roeycohen at gmail dot com
Hi, this is a complete sample:
http://blossom-kc.com/download/php_gettext/gettext.zip
(php.ini is included).
this sample works for a friend of mine, but not on my machine (windows 8 + iis + 5.5.7)
also, i am using iisreset to the restart the server (and tried reboot).
------------------------------------------------------------------------
[2013-12-11 18:14:58] ab@php.net
Hi,
I can't confirm the behavior you describe, works fine here with 5.5.5 and 5.5.6
Please check and post the following
- you've restarted the webserver
- the .mo file is present and is correct
- the .mo file is under locale\en_US\LC_MESSAGES\domain.mo
There must be something else otherwise in your environment, if this doesn't help.
Thanks.
------------------------------------------------------------------------
[2013-12-11 16:42:18] roeycohen at gmail dot com
Description:
------------
as simple as that, a code that used to work perfect now doesn't.
switching back to version 5.4.8 solves the problem.
i've made sure that in the php.ini the gettext extension is on
and also tried turning off OPCache, but it didn't help.
as a matter of fact, i've compared both php.ini to make sure that most options are the same.
Test script:
---------------
$domain = 'domain';
putenv("LC_ALL=en_US");
setlocale(LC_ALL, 'en_US');
$path = realpath('./locale');
bindtextdomain($domain, $path);
bind_textdomain_codeset($domain, "UTF-8");
textdomain($domain);
echo _('hello');
Expected result:
----------------
the text hello will be replaced with the string within the mo file.
Actual result:
--------------
the original string is returned.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66265&edit=1