which i18n function to use?
Dave Peticolas
dave@krondo.com
Sat, 31 Mar 2001 13:30:46 -0800
Christian Stimming writes:
> -----BEGIN PGP SIGNED MESSAGE-----
>
> Just a question before I mess up thing even more: What is the difference
> between the string translation functions (_ "some text") and (N_ "some
> text") ?
>
> And in what cases are we supposed to use which one? As far as I understood
> one of them should be used for strings that are some kind of keys, i.e.
> are used to look up some element in a list, and the other version is for
> strings which are only displayed but not used any further, e.g.
> tooltip/help strings. I thought the former is (N_ ) and the latter is (_ )
> . Is this correct or did I get something wrong?
You are correct. N_ returns the string argument it is given, and _
returns the translated version. With respect to the help strings in
options, those strings are run through gettext just before display,
and they've always been written with N_, even though they aren't used
as keys. I went through and looked for i18n problems in the reports
last night, and I think I changed some of the help strings to use N_
just to be consistent with prior usage.
dave