[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: localisation in system wide daemons

On Sat, Jan 20, 2007 at 10:45:07PM -0800, Don Armstrong wrote:
> On Sat, 20 Jan 2007, Steve Langasek wrote:
> > AFAICS, post-processing of log messages would be the most reliable
> > method to give admins localized logs while also making it feasible
> > for upstreams to support user requests. Any problems that would make
> > it hard to post-process English logs for localization would apply
> > n-fold to post-processing non-English logs for translation back to
> > English.
> But this style of post-processing would occur only when there was a
> support request that required an english speaker to look at the logs;

No; it would also occur when there is an automated system that tries to
look at the logs in an attempt to find something useful.

I've been thinking that it's not too hard to do this. The syslog()
API looks like this:

void openlog(const char *ident, int option, int facility);
void syslog(int priority, const char *format, ...);
void closelog(void);

(ignoring vsyslog for now, which takes a va_list)

Provided people are happy with the assumption that the "ident" argument
that's being presented to openlog() is valid as a gettext-style
domainname, all that's needed is a syslogd which is slightly smarter
than a regular syslogd, and which writes out messages it gets from the
syslog() call to two files: once translated, once not. Or, perhaps even
better: once translated, once not, and once without even the
printf-style processing that normally occurs in the syslog() call.

> Post-processing seems to require a set of fragile dependencies between
> the log processing software and the actual software generating the
> messages unless someone standardizes on a central repository of
> messages in different languages [and would make casual log checking
> slightly more difficult.]

Not quite.

<Lo-lan-do> Home is where you have to wash the dishes.
  -- #debian-devel, Freenode, 2004-09-22

Reply to: