#47479 [Com]: Again: setlocale() ignores translation setting

From: Date: Mon, 23 Feb 2009 14:01:03 +0000
Subject: #47479 [Com]: Again: setlocale() ignores translation setting
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1911@lists.php.net to get a copy of this message
ID: 47479 Comment by: szoftos at freemail dot hu Reported By: szoftos at freemail dot hu Status: To be documented Bug Type: Documentation problem Operating System: FreeBSD 7.0 PHP Version: 5.2.9RC3 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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 (#1911) next »