[MPlayer-dev-eng] Using gettext in MPlayer

Andras Mohari mayday at varoshaza.nagyatad.hu
Wed Jul 3 10:13:29 CEST 2002


Hi,

I saw in the -dev-eng archives that there was some discussion about
using GNU gettext in MPlayer.  I was playing with the 20020620 CVS
version to add gettext support and now it seems to work.

Before even trying to update it to current CVS and send a patch,
I'd like to know what you think about it.  I mean, why it'd be
rejected if I sent it. ;)

Below is the list of changes I made.

Modified configure:
* Removed the --language option. (help_mp-??.h files are not
  used anymore.  I should somehow move these messages into .po
  files...)
* configure adds the I18N variable to config.mak.
* config.h will define _() and N_() macros for marking translatable
  strings.  (mp_gettext() is not used anymore.)

Modified the main Makefile:
* 'make install' and 'make uninstall' descends into the new 'po'
  subdirectory.

New files:
* Added a po/ subdirectory for .po files. I wrote a Makefile that can
  be used to create the .po template and create/install/uninstall .mo
  files.  There are two scripts to help translators updating and
  testing their .po files.

  The messages catalogs are installed under $prefix/share/locale.
  (Maybe it should be configurable, eg: ./configure --localedir=...)

  Only the files listed in po/SRCFILES are searched for translatable
  messages.  It might be an annoyance for developers, but it's still
  better than looking through hundreds of *.[ch] files in different
  directories...

Modified sources:
* Copied help_mp-en.h as help_mp.h and marked all messages for
  translation.  I had to remove the #ifdefs from help_text and change
  it a bit, as xgettext extracts the #ifdef'ed parts too, so -gui,
  -dvd, -vcd and -[as]lang is included even if not supported.  (It
  shouldn't be a problem IMHO).
* Changed some messages: removed some '!' chars, changed
  wording.  (Some of them are cosmetical changes, so maybe I should
  revert them...)
* mp_msg() no longer translates strings (use _() when passing args).
* Marked MSGTR_* (and some other) messages for translation.  (I saw
  some MSGTR_MENU_* "       " concatenations -- are those spaces
  required???)

Whew, that's all I can remember.  Comments are welcome.

Regards,
-- 
Andras Mohari 
mayday at mail.nagyatad.hu



More information about the MPlayer-dev-eng mailing list