#47479 [Tbd->Csd]: Again: setlocale() ignores translation setting

From: Date: Wed, 13 Jan 2010 02:01:26 +0000
Subject: #47479 [Tbd->Csd]: Again: setlocale() ignores translation setting
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3684@lists.php.net to get a copy of this message
ID: 47479 Updated by: kalle@php.net Reported By: szoftos at freemail dot hu -Status: To be documented +Status: Closed Bug Type: Documentation problem Operating System: FreeBSD 7.0 PHP Version: 5.2.9RC3 -Assigned To: +Assigned To: kalle New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2010-01-13 02:01:09] svn@php.net Automatic comment from SVN on behalf of kalle Revision: http://svn.php.net/viewvc/?view=revision&revision=293477 Log: Fixed bug #47479 (setlocale() ignores translation setting) ------------------------------------------------------------------------ [2009-02-23 14:01:02] szoftos at freemail dot hu Right, thanks, this is a good answer to me. I only was too pushing because of that. The documentation should be clear this issue. And i was spending one day resolving that problem. Thank you. ------------------------------------------------------------------------ [2009-02-23 13:49:16] jani@php.net Gettext just does not work other than using those environment variables. If you disable setting them, you disable gettext. This is not a PHP bug, just another gettext limitation. Reclassified as documentation issue since this fact isn't mentioned in the gettext docus. ------------------------------------------------------------------------ [2009-02-23 13:13:34] szoftos at freemail dot hu umm, sorry, i was mistyped. I was told to set it at _startup_, but that's not good enough. I have to set it runtime. ------------------------------------------------------------------------ [2009-02-23 13:11:41] szoftos at freemail dot hu Description: ------------ Okay, i am posting this again, beacuse of my other bug was marked bogus, and i still think it's not: on BSD systems, setlocale itself is not usable for gettext without putenv(). If I don't use putenv() with setlocale() (which is not enabled by default in safe_mode=on for $LANG), my own translations are not useable with gettext. Since i use safe_mode, I'd not prefer enabling the setting of $LANG variable with putenv(). What I've seen during php ktracing, is that setlocale() only reads the original language settings from /usr/share/locale/*, but my own translations are not looked up. Is there any way to fix that functionality? Maybe it's more BSD related than I think. KEEP IN MIND: If you would like to build a multi-langual site with gettext, and the language have to be switched on-the-fly, you HAVE TO set te $LANG variable on each run. I was told to set it at runtime, but this is NOT an ELIGIBLE solution. Please don't mark it bogus, because this is a real problem with safe_mode=on. Reproduce code: --------------- You can simply try the gettext module's own tests to test it in BSD. They all will fail, because those tests aren't usint putenv(). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47479&edit=1

« previous php.doc.bugs (#3684) next »