Edit report at https://bugs.php.net/bug.php?id=66265&edit=1
ID: 66265
Comment by: lafleurpy at gmail dot com
Reported by: roeycohen at gmail dot com
Summary: gettext is not working anymore
Status: Closed
Type: Bug
Package: Gettext related
Operating System: windows
PHP Version: 5.5.7
Assigned To: ab
Block user comment: N
Private report: N
New Comment:
Same issue with wamp server 2.5 32bits on Windows 7 (with PHP : 5.5.12).
I confirm the trick given by sirio3mi to make gettext working.
It seems that only the folder with the current system locale is readable (for me /fr_BE).
Dictionaries in others directories (as /nl_BE) can't be loaded.
So I put all my POedit dictionaries in /fr_BE/LC_MESSAGES/ and named them with their corresponding
locale (ex : nl_BE.mo + nl_BE.po).
It's maybe dirty, but it works.
Here is the PHP code :
bind_textdomain_codeset ({your locale}, {your char codeset});
bindtextdomain ({your locale}, {absolute path to locale directory});
textdomain ({your locale});
setlocale (LC_ALL,{your locale});
putenv('LC_ALL=' . {your locale});
For making short : use the same locale directory but change the domain when you change the language.
Previous Comments:
------------------------------------------------------------------------
[2015-04-29 22:29:15] sirio3mil at gmail dot com
Hi, I have same problem with PHP 5.6.6 and 5.6.7 both TS x64 running on Apache over Windows Server
2008 R2 and Windows 10 TP.
I get only the translations to the default system lamguage (Control Panel) Temporary I change
location from all my .mo files to this folders and change domain to get correct translations.
------------------------------------------------------------------------
[2015-03-06 11:51:16] alvaro at demogracia dot com
Is there a new ticket for TS builds?
------------------------------------------------------------------------
[2014-11-26 16:21:28] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=56fac96bec882ac59a7fc298c98407bf4a17629d
Log: partially fixed bug #66265
------------------------------------------------------------------------
[2014-11-21 13:17:07] ab@php.net
I want to gratefully thank everyone who reported here and kindly ask to test this or later NTS
snapshot http://windows.php.net/downloads/snaps/php-5.5/rf2e33dc/
.
Yes, TS builds are still not fixed and there is no certainty they can be fixed, that's why i
reopen this. Even I'd rather mark this ticket as solved and move the remaining issue to another
one. As locale is not thread safe (for instance see bug #65769). Fortunately gettext isn't
really based on the locale functionality but on the exported vars, like LANGUAGE, LANG, LC_ALL or
LC_CTYPE. It might be also that the libintl will have to be patched once more to support TS builds.
It also seems that something has changed from VC9 to VC11 so then it affects the behaviour of the
libintl.
One note though about the snippets brought here so far, the following won't work on windows
setlocale(LC_ALL, 'de_DE');
de_DE isn't a valid locale on Windows, so the former should look like
setlocale(LC_ALL, 'de_DE', 'de-de');
and actually it could contain any number of locale names. While setlocale on windows wont directly
affect the gettext behaviour, merely it's an environment varibale as mentioned before.
Thanks.
------------------------------------------------------------------------
[2014-11-21 09:25:36] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=56fac96bec882ac59a7fc298c98407bf4a17629d
Log: partially fixed bug #66265
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=66265
--
Edit this bug report at https://bugs.php.net/bug.php?id=66265&edit=1