[Comerrers] Welcome and proposal

Jeffrey Hutzelman jhutz@cmu.edu
Fri, 10 May 2002 10:33:02 -0400 (EDT)


On Thu, 2 May 2002, Theodore Ts'o wrote:

> 	* The calling program may be using gettext --- or may not.
> 	* The shared library containing the error tables may be
> 		compiled on a machine where the gettext library is
> 		present --- or may not
> 	* Once compiled, the the shared library be moved to another
> 		system where the gettext library may be available ---
> 		or may not.

Really, none of this should matter.  The individual error tables should
know nothing about gettext; all the work should be done in the com_err
library itself.  Presumably that library was built with gettext support or
not depending on whether the system has it.

If people want to build com_err on one system and then move the library to
another differently-configured system, they need to be careful how they
build.  That might mean building com_err without gettext support.  Beyond
allowing for that, I don't think we need to worry about people moving
binaries.

> The way I'd handle this is let there be an initialization function
> which must be called by the program which initializes the base et
> library.  One of the things which this function can pass in is a
> pointer to the gettext function, or NULL if program isn't supporting
> GNU gettext.  (This initialization function may also be architecture
> dependent, if Windows or MacOS has specific needs that can't be
> handled in this generic fashion).
>
> This way, the et library doesn't have any dependencies on the libintl,
> and is fully backwards compatible with older programs.  It also solves
> the problem you mentioned:

I don't have any problem with a library interface that would allow the
application to provide an alternate gettext, or disable lookups of
localized messages entirely.  But I really would like to see applications
that use the default interface (i.e. no init function) to get localized
messages by default, if they are available.