Fix and simplify Hebrew (generally: locale non-standard) counters

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10430 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2005-09-08 16:57:13 +00:00
parent 9f3a134c99
commit 6c3d48c0c6
6 changed files with 45 additions and 30 deletions

View File

@ -1,3 +1,7 @@
2005-09-08 Martin Vermeer <martin.vermeer@hut.fi>
* he.po: move enum, appendix counter functionality here
2005-09-06 Michael Gerz <michael.gerz@teststep.org>
* de.po:

View File

@ -6694,7 +6694,7 @@ msgstr "i
#: lib/layouts/apa.layout:345 lib/layouts/apa.layout:346
msgid "(\\alph{enumii})"
msgstr ""
msgstr "(\\hebrew{enumii})"
#: lib/layouts/article.layout:18 lib/layouts/mwart.layout:23
#: lib/layouts/paper.layout:31 lib/layouts/scrartcl.layout:20
@ -9188,9 +9188,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 "@Section@.\\arabic{subsection}"
@ -9201,9 +9200,8 @@ msgid "@Subsection@.\\arabic{subsubsection}"
msgstr ""
#: lib/layouts/numarticle.inc:42 lib/layouts/numarticle.inc:43
#, fuzzy
msgid "@Subsubsection@.\\arabic{paragraph}"
msgstr "ä÷ńô úáéáń"
msgstr ""
#: lib/layouts/numarticle.inc:51 lib/layouts/numarticle.inc:52
msgid "@Paragraph@.\\arabic{subparagraph}"
@ -9215,7 +9213,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}"
@ -12114,6 +12112,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 ""

View File

@ -1,3 +1,8 @@
2005-09-08 Martin Vermeer <martin.vermeer@hut.fi>
* buffer_funcs.C:
* counters.[Ch]: clean up special code for Hebrew.
2005-09-08 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* lyxfunc.C (lookupChange): fix code when cursor depth is greater

View File

@ -22,6 +22,7 @@
#include "Floating.h"
#include "FloatList.h"
#include "gettext.h"
#include "language.h"
#include "LaTeX.h"
#include "lyxtextclass.h"
#include "paragraph.h"
@ -437,7 +438,7 @@ void setCounter(Buffer const & buf, ParIterator & it)
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");

View File

@ -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 const & format)
}
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}.");
}
else if (ctr == "enumii") {
format = N_("(\\alph{enumii})");
}
else if (ctr == "enumiii") {
format = N_("\\roman{enumiii}.");
}
else if (ctr == "enumiv") {
format = N_("\\Alph{enumiv}.");
}
return os.str();
return counterLabel(buf.B_(format));
}

View File

@ -18,6 +18,7 @@
#include <map>
#include <string>
#include "buffer.h"
/// This represents a single counter.
class Counter {
@ -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.