php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21447 gettext stopped working
Submitted: 2003-01-05 18:55 UTC Modified: 2003-05-20 05:06 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: vigna at acm dot org Assigned:
Status: Closed Package: Gettext related
PHP Version: 4.2.2 OS: Linux Red Hat 8.0
Private report: No CVE-ID: None
 [2003-01-05 18:55 UTC] vigna at acm dot org
After installing Red Hat Linux 8.0 with Apache 2, gettext support stopped working. I am using the sequence of calls

putenv("LANG=".$_ERW_locale);
setlocale(LC_MESSAGES, $_ERW_locale);
bindtextdomain("ERW", $_ERW_localePath);
textdomain("ERW");

to bind the text domain, and this worked perfectly in several different ERW installations (http://erw.dsi.unimi.it/) up to the upgrade.

It is very difficult to give any other hint. If you create a script like

<?php
putenv("LANG=it_IT");
setlocale(LC_MESSAGES, "it_IT");
bindtextdomain("ERW", "/home/vigna/cvs/ERW/php/locale");
textdomain("ERW");
print _("something translated");
?>

and the translation file is located as follows

/home/vigna/cvs/ERW/php/locale/it_IT/LC_MESSAGES/ERW.mo

the string does not get translated.

The complete lack of feedback of any of the gettext package functions makes it also very difficult to understand what's going wrong.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-05 18:58 UTC] iliaa@php.net
Which worker model are you using?
If you are using a thread based (worker) model you should be aware that gettext library is NOT thread safe and therefor you will encounter problems when you try using it within the threaded enviroment.
 [2003-01-11 18:19 UTC] vigna at acm dot org
No, I am using a stock Red Hat 8.0 and by default it should use the old process-per-request model (at least, httpd -l gives 

Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

Any suggestion?
 [2003-01-11 23:11 UTC] sniper@php.net
restored correct summary.

 [2003-01-27 22:32 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-05-20 03:20 UTC] b dot pura-vida at caramail dot com
Hi, 
I'm have exactly the same problem with Mandrake 9.0, Apache 1.3.26 and PHP 4.2.3 .
gettext does not translate anything, there isn't any error message neither warning. Nothing. 
Can somebody help?
 [2003-05-20 05:06 UTC] vigna at acm dot org
Simple: re-install with --force glibc-commons. RedHat install JUST the locales you required during the installation process (I'm not talking about the translation files--about the LOCALES!). So gettext does not find a locale, and does not translate (of course, it could be SO kind to give some error message!).

I filed this as a bug in Red Hat, and they claim that it is correct this way. No comment.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jan 29 11:01:24 2020 UTC