On Wednesday 03 April 2002 12:52 pm, Jean-Marc Lasgouttes wrote:
> >>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>
> Angus> On Tuesday 02 April 2002 4:56 pm, Jean-Marc Lasgouttes wrote:
> Claus> The help texts in the bottom of the preferences dialog also
> Claus> appear in English even though they were translated in the
> Claus> po-file.
>
> >>  Angus, could you have a look? It is a design decision to know at
> >> what time translation should take place. I would say in
> >> FormPreference::getFeedback.
>
> Angus> I think that I've finally twigged how N_() and _() are meant to
> Angus> be used. Anyway, the translations in the xforms stuff now all
> Angus> appear to work.
>
> Did you translate the units popups? How does this works when you type
> unit explicitely, as in 10in vs 10pouces? I think we should think
> twice before translating units.

No, I didn't. For exactly these reasons. However, in xforms_helpers.h we have:

// what we always need for lengths
string const choice_Length_All =
    "cm|mm|in|text%%|col%%|page%%|line%%|ex|em|pt|sp|bp|dd|pc|cc|mu";
string const choice_Length_WithUnit =
    "cm|mm|in|ex|em|pt|sp|bp|dd|pc|cc|mu";      // all with a Unit

These should be wrapped in N_().

The strings are used in several files and should be wrapped in _(), no?
Eg, in FormGraphics.C

fl_addto_choice(size_->choice_width, _(choice_Length_All).c_str());

Any unit defined in a function body also gets wrapped in _(), e.g.
        string const default_unit = _("in");

Have I understood correctly?

As for how they're used, FormGraphics (and I guess the other files too) have 
a little wrapper function:

bool isValid(FL_OBJECT * ob)
{
        string const input = getStringFromInput(ob);
        return input.empty() || isValidLength(input) || isStrDbl(input);
}

So, being able to enter 10pounces will depend on LyXLength.

> Angus> I suspect that these won't however. (Unless _() is called in
> Angus> setStatusMessage, if I understand things correctly.) Anyway,
> Angus> _() could be called directly here, since these messages are
> Angus> generated within a function rather than as static strings.
>
> Angus> Perhaps someone knowledgeable would check it out?
>
> I think it has to do with returning the message untranslated for the
> benefit of lyxserver, but I may be wrong. I'm not sure what the policy
> is, since it is not stated anywhere.
>
> JMarc

Well as a Frenchman, perhaps you'd check how these messages are displayed in 
the minibuffer? ;-)

Me? I tend to speak American, badly.

Angus

Reply via email to