Edit report at http://bugs.php.net/bug.php?id=49349&edit=1
ID: 49349 Comment by: egorinsk at gmail dot com Reported by: raulsalitrero at gmail dot com Summary: gettext behaves differently in php 5.3.0 (5.2.x ignored setlocale errors) Status: Assigned Type: Bug Package: Gettext related Operating System: win32 only - windows xp sp3 PHP Version: 5.3.0 Assigned To: pajoye New Comment: Hi, the same problem here with Windows XP SP2 and PHP 5.3.1 . In PHP 5.2, setlocale() call failed, but gettext() used information from LANG, LC_ALL and LANGUAGE variables. That was good, because I could use putenv() to change gettext() language on Windows and setlocale() on Linux. But now setlocale() on Windows fails, and gettext() always uses system locale, and messages are not translated. Actually, I don't need locales, they only bring problems, I'd prefer to always set it to POSIX locale to get consistent behaviour independent from server setup, but gettext() requires to use it :( Previous Comments: ------------------------------------------------------------------------ [2010-04-14 01:17:18] jorgecanta47 at hotmail dot com Same problem here with Windows Vista Home Premium, PHP 5.3.1 in XAMPP. Is there any workaround yet? Thanks ------------------------------------------------------------------------ [2010-04-05 17:19:37] euridica at narod dot ru Still same in 5.3.2. Translation is done only to default system locale. ------------------------------------------------------------------------ [2009-12-18 15:44:06] bengibollen at hotmail dot com I have got this problem as well. I'd like to add that the system default language/locale gets translated. But no other languages. Example: I have windows vista, English version, and the system default locale is set to Swedish. The strings that are supposed to be translated are all written in English; _("Hello World!"). I have made three translations: ./se/LC_MESSAGES/default.mo ./de/LC_MESSAGES/default.mo ./en/LC_MESSAGES/default.mo /*nonsense words/phrases only for testing*/ I always get the Swedish translation no matter what configurations* I try. If I rename the Swedish translation file I get no translation at all, only the default string. * I've tried all kind of parameters for the following: setlocale(LC_ALL, ...); putenv("LANGUAGE=..."); putenv("LANG=...");putenv("LC_ALL=..."); ------------------------------------------------------------------------ [2009-12-08 13:57:06] paulw at torchtrust dot org I am also getting this big. Is it fixed in 5.3.1? Is there a work around? Thanks Paul ------------------------------------------------------------------------ [2009-10-14 13:45:51] roger dot olivier at gmail dot com As asked by paj...@php.net you can found here an archive with a working script with 5.2.5 and not with 5.3.0 Tested on Xp pro Sp3 http://www.lanforums.com/dl/gettext-setlocale_BUG_5.3.0.zip Unzip and launch index.php. Expected result => print "Hello world" on screen Actual result => print "bonjour le monde" on screen ------------------------------------------------------------------------ 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 http://bugs.php.net/bug.php?id=49349 -- Edit this bug report at http://bugs.php.net/bug.php?id=49349&edit=1