php-i18n Digest 5 Apr 2003 15:03:50 -0000 Issue 164
Topics (messages 528 through 530):
Re: gettext problem - translation fails
528 by: Eneko Lacunza
529 by: Petr Vandrovec
PCRE support for utf8?
530 by: David Heath
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi,
El lun, 31 de 03 de 2003 a las 19:35, Petr Vandrovec escribió:
> On 31 Mar 03 at 12:16, Eneko Lacunza wrote:
> > El lun, 31 de 03 de 2003 a las 12:57, Petr Vandrovec escribiˇ:
> > > On 31 Mar 03 at 11:44, Eneko Lacunza wrote:
> > > > I'm having some problems with gettext and apache+php. The problem
> > > > starts when I update .mo files some PHP programs are using. Sometimes
> > > > (not everytime) gettext starts failing to traslate strings. When this
> > > > starts, gettext will translate about 1/4 of pages generated from PHP.
> > > You are installing .mo files wrong way. Please use 'install' program
> > > to install them, and restart apache afterwards. Do not install .mo
> > > files with 'cp' or 'cat'... .mo files should be treated same way as
> > > shared libraries.
> > Does this mean that the problem I'm suffering is "normal"? This would
> > make gettext almost unusable for real purposes in such environments 8(
> > Would it help if I first remove old .mo files?
> Yes, it will fix partial translations or core dumps. But apache will
> start using new files only after you restart it :-(
> Unfortunately according to my checks there is no way to invalidate
> this caching, glibc will always use already existing item from cache
> for same pair of values you pass to bindtextdomain(). So you have to either
> change domain name or locale path in your php code after each update
> of .mo files, or you have to restart apache.
This is quite strange. I don't have any knowledge about how glibc is
coded, but it seems that after "some time", the problem stabilizes and
all instances of apache translate correctly. Maybe it is that all "old"
instances crashed and new ones have the new .mo file.
Anyway, it is quite weird to have a production server in shuch a weird
state for some hours.
Although I don't know the problems involved here, I would suggest
trying to fix this in new glibc versions, maybe transparently, or maybe
with a simple function call (i.e. domain_refresh) that would force a
fresh load of the text domain.
Regards and thanks for your help.
--
Eneko Lacunza
Enlar/Euskalamiga
http://www.euskal.org
--- End Message ---
--- Begin Message ---
On 1 Apr 03 at 9:59, Eneko Lacunza wrote:
> > change domain name or locale path in your php code after each update
> > of .mo files, or you have to restart apache.
>
> This is quite strange. I don't have any knowledge about how glibc is
> coded, but it seems that after "some time", the problem stabilizes and
> all instances of apache translate correctly. Maybe it is that all "old"
> instances crashed and new ones have the new .mo file.
Or admin has set up Apache to run only limited number of requests in
each child. As your .mo files are loaded after server fork, it fixes problem
too. Only problem is that for some time you sometime get page with
new translation, and sometime with old.
> Although I don't know the problems involved here, I would suggest
> trying to fix this in new glibc versions, maybe transparently, or maybe
> with a simple function call (i.e. domain_refresh) that would force a
> fresh load of the text domain.
It would be nice. Long running processes are more and more common.
Petr Vandrovec
--- End Message ---
--- Begin Message ---
Hi,
does anyone know if it's possible to get the PCRE libraries to support
utf8 encoded strings. A cursory glance at the PCRE source which comes with
php4.2.3 suggests that it can support it, but that this is not enabled by
default.
I'm not a C programmer, but I have a feeling that it may be just a matter
of changing a compile flag to PCRE.
(the motivation for doing this would be to unicode-enable an existing app
which uses PCRE functions).
Would very much appreciate comments from those in the know!
Thanks
David Heath
Web Developer
OneWorld International Ltd
London, UK
http://www.oneworld.net/
--- End Message ---