On Fri, 02 Sep 2005 11:57:30 +0300 Martin Vermeer <[EMAIL PROTECTED]> wrote:
> On Fri, 2005-09-02 at 11:28, Jean-Marc Lasgouttes wrote: > > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: ... > > JMarc > > Yes, this does the job. Great! > > - Martin Here finally the full updated patch. You will see that I include chunks to the he.po file... I don't want to do this, but this patch moves functionality out to he.po that was previously (in lyx-1.2) hardwired in the C++ code (Which now looks a lot cleaner BTW). So that is why I think this is justified. Should work out of the box. - Martin Index: src/buffer_funcs.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer_funcs.C,v retrieving revision 1.31 diff -u -p -r1.31 buffer_funcs.C --- src/buffer_funcs.C 9 Jun 2005 09:58:05 -0000 1.31 +++ src/buffer_funcs.C 4 Sep 2005 16:20:53 -0000 @@ -23,6 +23,7 @@ #include "Floating.h" #include "FloatList.h" #include "gettext.h" +#include "language.h" #include "LaTeX.h" #include "lyxtextclass.h" #include "paragraph.h" @@ -440,7 +441,7 @@ void setCounter(Buffer const & buf, ParI counters.step(enumcounter); - par.params().labelString(counters.enumLabel(enumcounter)); + par.params().labelString(counters.enumLabel(enumcounter, buf)); } else if (layout->labeltype == LABEL_BIBLIO) {// ale970302 counters.step("bibitem"); int number = counters.value("bibitem"); Index: src/counters.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/counters.C,v retrieving revision 1.34 diff -u -p -r1.34 counters.C --- src/counters.C 6 Jan 2005 16:39:22 -0000 1.34 +++ src/counters.C 4 Sep 2005 16:20:54 -0000 @@ -14,6 +14,7 @@ #include "counters.h" #include "debug.h" +#include "gettext.h" #include "support/lstrings.h" #include "support/convert.h" @@ -315,29 +316,22 @@ string Counters::counterLabel(string con } -string Counters::enumLabel(string const & ctr, string const & langtype) +string Counters::enumLabel(string const & ctr, Buffer const & buf) { - ostringstream os; + string format; - if (langtype == "hebrew") { - if (ctr == "enumi") - os << '.' << value("enumi"); - else if (ctr == "enumii") - os << '(' << hebrewCounter(value("enumii")) << ')'; - else if (ctr == "enumiii") - os << '.' << lowerromanCounter(value("enumiii")); - else if (ctr == "enumiv") - os << '.' << alphaCounter(value("enumiv")); - } else { - if (ctr == "enumi") - os << value("enumi") << '.'; - else if (ctr == "enumii") - os << '(' << loweralphaCounter(value("enumii")) << ')'; - else if (ctr == "enumiii") - os << lowerromanCounter(value("enumiii")) << '.'; - else if (ctr == "enumiv") - os << alphaCounter(value("enumiv")) << '.'; + if (ctr == "enumi") { + format = N_("\\arabic{enumi}."); } - - return os.str(); + else if (ctr == "enumii") { + format = N_("(\\alph{enumii})"); + } + else if (ctr == "enumiii") { + format = N_("\\roman{enumiii}."); + } + else if (ctr == "enumiv") { + format = N_("\\Alph{enumiv}."); + } + format = N_("\\Alph{enumiv}."); + return counterLabel(buf.B_(format)); } Index: src/counters.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/counters.h,v retrieving revision 1.17 diff -u -p -r1.17 counters.h --- src/counters.h 6 Oct 2003 15:42:13 -0000 1.17 +++ src/counters.h 4 Sep 2005 16:20:54 -0000 @@ -78,7 +79,7 @@ public: /// according to the given format std::string counterLabel(std::string const & format); /// A complete label, like 1.a for enumerations - std::string enumLabel(std::string const & ctr, std::string const & langtype = "latin"); + std::string enumLabel(std::string const & ctr, Buffer const & buf); private: /// A counter label's single item, 1 for subsection number in /// the 2.1.4 subsubsection number label. Index: po/he.po =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/he.po,v retrieving revision 1.56 diff -u -p -r1.56 he.po --- po/he.po 17 Jul 2005 23:57:21 -0000 1.56 +++ po/he.po 4 Sep 2005 16:21:06 -0000 @@ -9144,9 +9205,8 @@ msgid "Part \\Roman{part}" msgstr "" #: lib/layouts/numarticle.inc:16 -#, fuzzy msgid "\\Alph{section}" -msgstr "ïååéë" +msgstr "hebrew{section}" #: lib/layouts/numarticle.inc:24 lib/layouts/numarticle.inc:25 msgid "@[EMAIL PROTECTED]" @@ -9157,9 +9217,8 @@ msgid "@[EMAIL PROTECTED] msgstr "" #: lib/layouts/numarticle.inc:42 lib/layouts/numarticle.inc:43 -#, fuzzy msgid "@[EMAIL PROTECTED]" -msgstr "ä÷ñô úáéáñ" +msgstr "" #: lib/layouts/numarticle.inc:51 lib/layouts/numarticle.inc:52 msgid "@[EMAIL PROTECTED]" @@ -9171,7 +9230,7 @@ msgstr "" #: lib/layouts/numreport.inc:15 msgid "Appendix \\Alph{chapter}" -msgstr "" +msgstr "Appendix \\hebrew{chapter}" #: lib/layouts/numreport.inc:21 msgid "\\arabic{chapter}.\\arabic{section}" @@ -12070,6 +12129,18 @@ msgstr "" msgid "An empty output file was generated." msgstr "" +#: src/counters.C:324 +msgid "\\arabic{enumi}." +msgstr ".\\arabic{enumi}" + +#: src/counters.C:332 +msgid "\\roman{enumiii}." +msgstr ".\\roman{enumiii}" + +#: src/counters.C:336 +msgid "\\Alph{enumiv}." +msgstr ".\\Alph{enumiv}" + #: src/debug.C:43 msgid "Program initialisation" msgstr ""