[imp] Translation cache?

Jan Schneider jan at horde.org
Fri Oct 29 14:41:40 PDT 2004


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?

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/


More information about the imp mailing list