- 论坛徽章:
- 0
|
对,gettext,下面这个message可以做解释.
Re: _() Macro
From: Trevor Johnson <trevor jpj net>
To: Andreas Sliwka <goff nef wh uni-dortmund de>
cc: gtk-app-devel-list redhat com
Subject: Re: _() Macro
Date: Sat, 20 Nov 1999 07:26:36 -0500 (EST)
> Hi,
Hi, Andreas.
> I jsut read the gnome documentation and found in gnomeabout.html the
> macro _() (it wasnt defined but used). The corresponding text says:
> >note that the descriptive text is surrounded by the _(). This will have
> > the text translated to the the user's language at runtime.
>
> How is this done? Where do I find more information/documentation about this?
If you have GNU gettext, you can read about it on one of the gettext info
pages:
Many packages use `_' (a simple underline) as a keyword, and write
`_("Translatable string" ' instead of `gettext ("Translatable
string" '. Further, the coding rule, from GNU standards, wanting that
there is a space between the keyword and the opening parenthesis is
relaxed, in practice, for this particular usage. So, the textual
overhead per translatable string is reduced to only three characters:
the underline and the two parentheses. However, even if GNU `gettext'
uses this convention internally, it does not offer it officially. The
real, genuine keyword is truly `gettext' indeed. It is fairly easy for
those wanting to use `_' instead of `gettext' to declare:
#include <libintl.h>
#define _(String) gettext (String)
instead of merely using `#include <libintl.h>'.
> mfg
Mit freundlichen gruessen.
__
Trevor Johnson |
|