Thanks, Jean-Marc. Got it.

Am I right in saying that the important point here is "you cannot call 
gettext() in a static initialization".

Ie,

string str = N_("some text");
fl_set_object_label(obj, _(str));

is correct, because 

string str = _("some text")

fails to compile. This is also correct:

string const getDescription() {
        string str = N_("some text");
        str = _(str);
}

string str;

if (some choice) {
        str = getDescription();
}
fl_set_object_label(obj, str);

If this is Ok, then I think I'll do it this way (keep the N_() and the _() in 
the same file).

Angus




On Tuesday 05 December 2000 15:10, Jean-Marc Lasgouttes wrote:
> >>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>
> Angus> On Monday 04 December 2000 17:52, Dekel Tsur wrote:
> >> On Mon, Dec 04, 2000 at 11:23:31AM +0000, Angus Leeming wrote: >
> >> Why not? They appear in my lyx.pot file. I guess you mean that they
> >>
> >> > aren't in yours? > > Admittedly, "GUI background" etc don't
> >>
> >> appear. Will investigate.
> >>
> >> You should use 'xcol.name = _("GUI background")' instead of using
> >> N_(). There are several places in your code that need to fixed.
> >> Note that in some places you need to keep the N_() but put a _()
> >> when the string is used. For example, keep the N_() in
> >> LyXRC::getDescription but in FormPreferences::feedback you need to
> >> put str = formatted(_(str), ...)
>
> Angus> This shouldn't be that hard, but I'm completely confused here.
>
> Angus> Why should I keep N_() for one (and then put a _() when the
> Angus> string is used), but remove it for xcol.name?
>
> _() is the normal gettext macro. N_() is just a dummy macro which
> force the string to be in the lyx.pot file (to use in string arrays,
> for example). It is because you cannot call gettext() in a static
> initialization.
>
> Angus> Yes, I have read src/gettext.h. I guess I could rephrase the
> Angus> question as what makes the strings in LyXRC::getDescription
> Angus> "static"; what does "static" mean here?
>
> That the variable is local to the function, I guess.
>
> JMarc

Reply via email to