[kronolith] Alarm message date format not localised

Clarke Brunt clarke.brunt at viridis.net
Wed May 3 06:18:22 PDT 2006


Quoting Chuck Hagenbuch <chuck at horde.org>:

> Quoting Clarke Brunt <clarke.brunt at viridis.net>:
>
> > I see that the offending date comes from a strftime('%x',...) in
> > lib/Scheduler/kronolith.php
>
> %x is a locale-appropriate timestamp. You probably have your locale  
> set to en_US instead of en_GB.

OK. I've done (on Debian) dpkg-reconfigure locales, which allowed me to
generate en_GB and set it to be the default. And I've restarted Apache. But
the date in alarm emails is still coming out in US format (month/day/year).

In the PHP shell in Horde, if I just print the result of a
strftime('%x',...), then I get US format. If I precede it with
setlocale(LC_TIME, 'en_GB') then I get British format (day/month/year), so I
conclude that it at least has the ability to work.

In the CLI shell in Horde, the results from 'set' and 'printenv' still
include LANG and LANGUAGE set to en_US. Possible the Apache startup script
in /etc/init.d is trying to prevent it from seeing environment variables, as
I see it running apachectl with 'env -I LANG=C...'.

I'm afraid I'm getting beyond my own knowledge in trying to work out what is
going on here. Could it be anything to do with the fact the the scheduler
generating the Kronolith alarm emails runs as a cron job (which has just
made me think - this is command line PHP, and probably nothing to do with
Apache), so no user is logged into Horde to generate the alarms? When I _do_
log into Horde, I select English (British) as my language on the login
screen, but the scheduler won't know about selected languages. I see code in
horde3/lib/Horde/NLS.php trying to determine the language from various
places, and defaulting to en_US, but I don't know whether this code is
invoked by the scheduler, or whether there would be any sensible place for
it to get a language from. I see $nls['defaults']['language'] = ''; in
horde3/config/nls.php. Perhaps this is the place to put en_GB, though this
then appears to take preference over HTTP_ACCEPT_LANGUAGE?



More information about the kronolith mailing list