On Thu, Sep 01, 2005 at 11:58:39AM +0200, Jean-Marc Lasgouttes wrote:
> >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> 
> Martin> As bugzilla is down, attached the summary of my hebrew-related
> Martin> changes as a patch.

...
 
> We should not need to pass the language to the counter methods.
> Actually only enumLabel needs it for now, but it can be fixed by
> something like (untested):
> 
> string Counters::enumLabel(string const & ctr, Buffer const & buf)
> {
>         string format;
> 
>       if (ctr == "enumi")
>               format = buf.B_("\\arabic{enumi}.");
>       else if (ctr == "enumii")
>               format = buf.B_("(\\alph{enumii})");
>       else if (ctr == "enumiii")
>               format = buf.B_("\\roman{enumiii}.");
>       else if (ctr == "enumiv")
>               format = buf.B_("\\Alph{enumiv}.");
>       }
> 
>       return counterLabel(format);
> }
> 
> This would allow to make the hebrew tricks in he.po, but also to
> change for other languages (at least french would like that). I really
> think most explicit tests for "hebrew" should go away.

OK, I did this: 

string Counters::enumLabel(string const & ctr, Buffer const & buf)
{
        string format, dummy;

        if (ctr == "enumi") {
                dummy = _("\\arabic{enumi}."); // Keep this for gettext!
                format = buf.B_("\\arabic{enumi}.");
        }
        else if (ctr == "enumii") {
                dummy = _("(\\alph{enumii})");
                format = buf.B_("(\\alph{enumii})");
        }
        else if (ctr == "enumiii") {
                dummy = _("\\roman{enumiii}.");
                format = buf.B_("\\roman{enumiii}.");
        }
        else if (ctr == "enumiv") {
                dummy = _("\\Alph{enumiv}.");
                format = buf.B_("\\Alph{enumiv}.");
        }

        return counterLabel(format);
}

The _( in addition to B_( are needed for the pot file to pick them up.
(Or one would have to add special code to po/Makefile, like what
currently parses the layout files...) I'm open to suggestions for a less
socialistic-realistic solution.

This created a problem in tex2lyx: it (in the link phase) complained 
about Buffer::B_() not being defined. This was solved by *copying*,
instead of symlinking, counters.C to this directory and stripping it
from everything not needed there, including enumLabel.

This works. I suggest this should go in for 1.4, minus any warts found 
in testing. It makes the code *a lot* simpler.

Patch coming when Lars has recovered his screwdriver ;-)

- Martin

Attachment: pgphnmlA7QkiZ.pgp
Description: PGP signature

Reply via email to