[MPlayer-dev-eng] [PATCH] GTK2 support

Rich Felker dalias at aerifal.cx
Tue Feb 21 19:38:56 CET 2006


On Tue, Feb 21, 2006 at 11:11:20AM +0100, Torinthiel wrote:
> > > Unless someone comes with a way to do it correctly, i.e. making gtk1,
> > > gtk2, utf-8 consoles and non-utf consoles working. The gettext might be
> > > a way. There is code to convert .h files to gettext's .po files, I'll
> > > send it on request, all that is left is integrating it into configure.
> > 
> > I oppose using gettext. It's bloated and catgets (the standard POSIX
> > message catalog system as opposed to the GNU replacement) fits much
> > better with MPlayer's existing model of using #defines for the
> > messages. Look up catgets and see how it works.
> 
> I'll try, although a pointer to the doc's could be useful. Only thing
> now I know about catgets is what was in gettext's manual. I agree that
> it suits MPlayer's model better then gettext, and I think it will be
> quite simple to convert to catgets, but having in mind that catgets
> might not be available (as well as gettext ;)
> And yes, gettext is bloated. I only proposed it because most of the work
> is already done (but most of that could be reused).

Here's how it could be done, with almost no changes to MPlayer:

The MSGTR_ constants are defined as:

#define MSGTR_Foo catgets(mp_catalog, SET_NUMBER, MSG_NUMBER, "Foo")

Where SET_NUMBER and MSG_NUMBER are constant numbers for the message
which we put inline in the define.

In the absence of catgets, we could either:
#define catgets(a,b,c,d) (d)
or use the existing system.

IMO we put the above style #defines in help_mp-en.h, and define
catgets away if catgets if it's not desired by the user. Then we leave
the other language files as-is, and make a script to convert them into
message catalogs, taking the message numbers from the corresponding
English messages (message with same MSGTR_ name).

Rich


P.S. Why do I hate gettext? I'm strongly against using a hashtable to
lookup values (at runtime) that are CONSTANT at compiletime. That's
bloatware at its finest!




More information about the MPlayer-dev-eng mailing list