php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #17304 Cannot get gettext working
Submitted: 2002-05-18 06:55 UTC Modified: 2002-05-24 14:54 UTC
From: jsakalos at bigfoot dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.2.0 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jsakalos at bigfoot dot com
New email:
PHP Version: OS:

 

 [2002-05-18 06:55 UTC] jsakalos at bigfoot dot com
I use SuSE Linux 7.3 distribution but I compiled 
PHP 4.2.0 from source as an apache module 
--with-apxs and --with-gettext=/usr

I also compiled gettext 0.11.2 from source. I tried also
--with-included-gettext in vain.

When I use gettext from command line, it works:

env LANG=sk_SK gettext -sd bsis "This I want to translate"
Toto chcem prelozit

or, when my locale is not in /usr/share/locale

env LANG=sk_SK TEXTDOMAINDIR=/web/bsis/locale gettext ....

The PHP script I use is:

putenv("LANG=sk_SK");
bindtextdomain("bsis", "./locale");
textdomain("bsis");
echo _("This I want to translate");

Running this script I always get only the english text.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-18 07:00 UTC] mfischer@php.net
Have you tried php.net/setlocale ?
 [2002-05-18 09:54 UTC] jsakalos at bigfoot dot com
Thanks,
when I use setlocale instead of putenv it works fine.

The documentation should be updated accordingly as, sticking on it, I lost a day doing trial and error.

Someone else might too...
 [2002-05-18 09:55 UTC] mfischer@php.net
Good idea. 
 [2002-05-24 14:54 UTC] derick@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 23:01:33 2025 UTC