[imp] Translation cache?

Fabio Gomes flgomes at fazenda.sp.gov.br
Thu Nov 4 06:11:31 PST 2004


Em Sex 29 Out 2004 18:49, Fabio Gomes escreveu:
> Em Sex 29 Out 2004 18:41, Jan Schneider escreveu:
> > Zitat von Fabio Gomes <flgomes at fazenda.sp.gov.br>:
> > > Em Sex 29 Out 2004 12:48, Jan Schneider escreveu:
> > >> Zitat von Fabio Gomes <flgomes at fazenda.sp.gov.br>:
> > >> > Em Qui 28 Out 2004 17:15, Jan Schneider escreveu:
> > >> >> Zitat von Fabio Gomes <flgomes at fazenda.sp.gov.br>:
> > >> >> > Hi list,
> > >> >> >
> > >> >> > 	I'm getting a strange behavior of my Horde installation after
> > >> >> > update. Any translation made in the .po files doesn't reflect in
> > >> >> > the system. I'm using a Solaris 8 box and I compiled the .po
> > >> >> > with:
> > >> >> >
> > >> >> > 	msgfmt -v -o ../locale/pt_BR/LC_MESSAGES/horde.mo pt_BR.po
> > >> >> >
> > >> >> > 	The weird thing is that the same command still working with may
> > >> >> > horde 2.0 installation. It seems the gettext is caching the
> > >> >> > translation, or something about that.
> > >> >>
> > >> >> Exactly, this how gettext works.
> > >> >>
> > >> >> > 	I created a langtest.php (language test) as suggested in
> > >> >> > docs/TRANSLATION. That worked fine and the updates was displayed.
> > >> >> > Invoking gettext in the command line also works:
> > >> >> >
> > >> >> > 	# export
> > >> >> > TEXTDOMAINDIR=/usr/local/apache/htdocs/horde-2.2.7/locale #
> > >> >> > gettext horde "Mail"
> > >> >> > 	Webmail
> > >> >> >
> > >> >> > 	The above shows my update. I changed "Mail" translation from
> > >> >> > "Correio" to "Webmail". The Apache (webserver) was restarted to
> > >> >> > see if anything changes. Nothing changed.
> > >> >>
> > >> >> That should have worked. Other than that I don't know what to tell
> > >> >> you.
> > >> >>
> > >> >> Jan.
> > >> >
> > >> > Do you want to know a funny thing? Renaming horde/locale to a random
> > >> > name doesn't affect the translations. The pages still being
> > >> > translated. Is there any way to track horde and see what file it is
> > >> > using as source for its translations?
> > >>
> > >> Only by tracing the Apache processes, this is handled tranparently by
> > >> the PHP gettext extension. Actually by the gettext library.
> > >
> > > Well, I was avoiding tracing the process. But I did:
> > >
> > > 1099:  
> > > open("/usr/local/apache/htdocs/horde-2.2.7/locale/pt_BR/LC_MESSAG
> > > ES/horde.mo", O_RDONLY) = 7
> > > 1099:   fstat64(7, 0xFFBE92E8)                          = 0
> > > 1099:   mmap(0x00000000, 20924, PROT_READ, MAP_SHARED, 7, 0) =
> > > 0xFE660000 1099:   close(7)                                        = 0
> > >
> > > Yes, he's open the right file. At least, thats what it says. And then,
> > > maps the file descriptor of the horde.mo to memory (is that right?).
> > >
> > > When I remove the horde/locale directory it tries to open the horde.mo
> > > and gives an error. But I didn't see the apache falling back to another
> > > .mo file:
> > >
> > > 6559:  
> > > open("/usr/local/apache/htdocs/horde-2.2.7/lib/../locale/pt_BR/LC
> > > _MESSAGES/horde.mo", O_RDONLY) Err#2 ENOENT
> > >
> > > Maybe it's getting the translations from a already mapped file
> > > descriptor. I don't know how to trace this, and that's not valueable.
> > >
> > > Do you know any other way to clean completely the Apache/PHP caches',
> > > besides apache restart and machine reboot?
> >
> > No, this should really do it. Try asking the gettext folks, they can
> > probably explain the internal behavior.
> >
> > Just a last suggestion: I guess you're using Solaris' gettext libraries
> > (you were on Solaris, weren't you?), did you try to install recent GNU
> > gettext libraries instead?
>
> I'm gonna try to browse gettext lists. And yes, that's a solaris box. Well
> guessed.
> I didn't try to install GNU gettext yet because my previous installation of
> Horde/Imp works fine with Solaris gettext. And I'm not sure if I have to
> recompile PHP, also, with this new gettext (I think not). Well, I'm going
> to install GNU gettext, doesn't it hurt to try.
>
> Thank you again for help me,

  Omg, guess what. As I said I updated the translation of the string "Mail" in 
horde/po/pt_BR.po file. That's the only po file in my installation with the 
string "Mail". Then, was there I made the change.
But doing some debug in my installation today I figured out that Horde/IMP was 
looking for the translation of the string "Mail" in horde/imp/locale, not in 
horde/locale where should be the right place to check.

  Then I discovered that the already compiled 
horde/imp/locale/pt_BR/LC_MESSAGES/pt_BR.mo file had the translation for 
"Mail" in it, but the pt_BR.po file hasn't.
What I've done? I included the translation for the string "Mail" in IMP 
pt_BR.po file and recompiled it. Then the translation worked as was supposed 
to work.

  Then be aware: The po files with the IMP instalation DOES NOT reflect the 
already compiled mo files.

Just for feedback.

Best regards,
-- 
Fábio Gomes


More information about the imp mailing list