Bug #30597 [Com]: GETTEXT strings occasionally don't get translated
| From: | jannacecek at seznam dot cz | Date: | Tue, 06 Oct 2020 14:20:01 +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-229420@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: jannacecek at seznam dot cz
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:
I have the same problem with gettext and dockerized debian (FROM php:7.4-apache). For me it takes
exactly 102 page reloads to switch between a translation and the default text (102 times transalted
string, then 102 times untranslated string). I'm puzzled!
Previous Comments:
------------------------------------------------------------------------
[2019-10-04 13:33:25] c3337963 at urhen dot com
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?
------------------------------------------------------------------------
[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".
------------------------------------------------------------------------
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