#19153 [NEW]: Gettext not working correctly

From: Date: Wed, 28 Aug 2002 15:36:02 +0000
Subject: #19153 [NEW]: Gettext not working correctly
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18040@lists.php.net to get a copy of this message
From: pepek@pobox.sk Operating system: Linux PHP version: 4.2.2 PHP Bug Type: Gettext related Bug description: Gettext not working correctly Hi, I compiled PHP 4.2.2 with gettext support on Mandrake 8.2, gettext is of version 0.10.40 (default in Mandrake distr.) Everything is working FINE for locales that I have installed in Mandrake, but for any other locales gettext fails to read mo file. I tested it with a fictive locale, xx_XX: ***************** putenv('LANG=xx_XX'); putenv('LANGUAGE=xx_XX'); setlocale(LC_ALL, 'xx_XX'); setlocale(LC_MESSAGES, 'xx_XX'); bindtextdomain('messages', './locale'); textdomain('messages'); echo _("select"); ***************** this script didn't work. But it started to work after I created directory /usr/share/locale/xx_XX and copied there content of en (or any other locale) directory. It looks like gettext needs to read something from /usr/share/locale first. Is it feature or bug? Binary gettext works correctly even without /usr/share/locale/xx_XX directory. In bash I successfuly ran: ******************************* $ export LANGUAGE=xx_XX $ export TEXTDOMAINDIR=./locale $ export TEXTDOMAIN=messages $ gettext "select" Vyber-xx-OK ******************************* And nothing changed after I installed the newest gettext and recompiled php with --with-gettext=/usr/local My configuration is: ./configure \ --with-apxs=/usr/local/apache/bin/apxs \ --with-config-file-path=/etc \ --with-pear \ --enable-magic-quotes \ --disable-short-tags \ --with-gettext=/usr/local \ --with-mysql \ --with-zlib Peter Belak pepek@pobox.sk -- Edit bug report at http://bugs.php.net/?id=19153&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19153&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19153&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19153&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19153&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19153&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19153&r=support Expected behavior: http://bugs.php.net/fix.php?id=19153&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19153&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19153&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19153&r=globals

« previous php.bugs (#18040) next »