Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

> 
> Bo Peng wrote:
> 
> >> while translating the listing dialog messages, I found a few minor
> >> problems:
> > 
> > I am not familiar with either qt or gettext so I will leave these to
> > others.
> 
> It might be because those strings are marked N_() (I thought the would
> become translatable nevertheless, but I might be wrong). The alternative is
> to mark them _(), but then, they need to be transferred to docstring.
> 
> Unfortunately, I don't have access to the sources now.

For those of you confused by this gettext stuff...

N_() and _() are fundamentally different.

N_() exists only to enable the po machinery to extract translatable strings 
into the .po files. It's a macro that doesn't actually do *anything*. 
Typically, it's used to wrap around strings that aren't in an execution path.

Eg

char const * const ok_label = N_("Ok");

int main()
{
     std::cout << ok_label << std::endl;
}

The code above won't actually print a translated "Ok". To do that, you have to 
invoke gettext using _():

char const * const ok_label = N_("Ok");

int main()
{
     std::cout << _(ok_label) << std::endl;
}

Of course, if the content of the label lies within the _() then the po 
machinery can extract that directly. No need for N_():

int main()
{
     std::cout << _("Ok") << std::endl;
}

Have I given you a clue,
Angus

Reply via email to