Re: all _() defines for i18n

Gediminas Paulauskas <menesis delfi lt> writes:

> So, summary of all that is:
> msgid "verb|file"
> msgstr "put"
> or 
> msgstr "action|put"
> Translators not always understand what happens here and translate what
> they do not need to :)

In its twisted ways this comes to the right conclusion.  Although
there is not the slightest problem with strings containing |
characters.  This simply means you'll have to add the noun| prefix
even in the translation (or even only |).

It would have been much easier if would have read the glibc manual.
I've described all this long ago.

> The last two, D_() and L_(), are ideas used in
> libgnomeui/gnome-app-helper.[ch], and are useful for libraries.
> L_(string) is used where N_("something") can be passed both from library
> and from application, and there is no way to determine which domain to
> use. So both are tried. I used this in gal/widgets/e-popup-menu.c.
> D_() means explicit default domain, i.e. gettext() in case of
> #define _(x) dgettext(PACKAGE, x)
> Which should be used in libraries.

This is not good.  Heuristics have the tendency to fail.

[I'm speaking here in Xt terms since this is the only widget set I
really know.]  You should have a private element of the widget data
structure which is (optionally) set at construction time and can be
changed using some functions.  This extra element would be the domain
name string.  It probably should default to the value returned by

For an example you can look at the argp functions in glibc.  They have
the domain string in the structure the user provides.  Programs never
have to care.  Library authors (who always need a deeper understanding
anyway) need to set this element accordingly.

---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at   `------------------------

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