php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19153 Gettext not working correctly
Submitted: 2002-08-28 11:36 UTC Modified: 2002-09-03 23:48 UTC
From: pepek at pobox dot sk Assigned:
Status: Not a bug Package: Gettext related
PHP Version: 4.2.2 OS: Linux
Private report: No CVE-ID: None
 [2002-08-28 11:36 UTC] pepek at pobox dot sk
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-03 23:48 UTC] kalowsky@php.net
Marking this as bogus, due to what I rememeber of gettext this is standard behavior (aka not a PHP issue).  If I'm wrong, re-open the bug.  
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC