Bug #30597 [Com]: GETTEXT strings occasionally don't get translated

From: Date: Fri, 04 Oct 2019 13:33:25 +0000
Subject: Bug #30597 [Com]: GETTEXT strings occasionally don't get translated
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223079@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=30597&edit=1

 ID:                 30597
 Comment by:         c3337963 at urhen dot com
 Reported by:        schnaaf at home dot nl
 Summary:            GETTEXT strings occasionally don't get translated
 Status:             No Feedback
 Type:               Bug
 Package:            Gettext related
 Operating System:   FreeBSD 4.7
 PHP Version:        4.3.8
 Block user comment: N
 Private report:     N

 New Comment:

Reproduced for PHP 5.3 / Appweb 4.7 / gettext 0.19 on Linux
with code like:
----------------
  ...
// we want only LC_MESSAGES to be affected, so...
// (according to http://www.gnu.org/software/gettext/manual/html_node/Locale-Environment-Variables.html)
  putenv('LANGUAGE=');
  putenv('LANG=POSIX');
  setlocale(LC_ALL, '');
  setlocale(LC_MESSAGES, 'cs_CZ.utf8');

  bindtextdomain('messages', '/opt/app/locale');
  bind_textdomain_codeset('messages', 'UTF-8');
  textdomain('messages');
  ...
// and now use _()
  ...
----------------
and /opt/app/locale/cs/LC_MESSAGES/messages.mo file.

Also one can check the following SO link:
https://stackoverflow.com/questions/10508305/gettext-works-sometimes

Is there any workarounds or something?


Previous Comments:
------------------------------------------------------------------------
[2011-09-06 12:35:04] teemu at 1up dot fi

Just for a notice, you have to restart Apache (or whatever) every single time 
when you do any kind of modifications into the translations file. If you don't, 
gettext will sometimes return your new string but instead it will return more 
often that string, what's passed to it as an argument. So the translation with 
gettext don't work properly if you don't restart your www-daemon.

------------------------------------------------------------------------
[2005-11-07 10:31:27] c dot affolter at stepping-stone dot ch

Same problem encountered with PHP 5.1.0RC1/Apache 2, gettext 0.13.

As mentioned in the previous comment, it seems to be a PHP issue, since the translation is working
correctly via the native gettext command.

------------------------------------------------------------------------
[2005-02-23 22:32:24] wolfgang dot pichler at ivv dot tuwien dot ac dot at

same phenomenon observed in project www.emilda.org from different people with different versions of
apache,php,gettext,linux ....

VERY SPURIOUS

i would think it is some major php design bug :-)

------------------------------------------------------------------------
[2005-01-15 01:00:08] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------
[2005-01-07 15:56:11] alain at parkautomat dot net

http://parkautomat.net/php4gettextbug.tar.gz

It includes a sample php file and some translated messages. This shows the exact problem here.

Distribution: Debian GNU/Linux
Versions:
gettext        0.14.1
php4           4.3.9
apache         1.3.26.1

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=30597


--
Edit this bug report at https://bugs.php.net/bug.php?id=30597&edit=1


Thread (12 messages)

« previous php.bugs (#223079) next »