On Thu, 2004-10-07 at 14:16, Angus Leeming wrote: > Jean-Marc Lasgouttes wrote: > > Angus> Maybe ;-) If you add 'language' to OutputParams then I'm > > afraid Angus> you should also change 'lang' to something more > > verbose and Angus> meaningful. > > > > Something like doclang and loclang, maybe. > > I'd prefer 'document_language' and 'local_language'. Let's try and > make the sources self documenting if we can...
OK, all done. See attached. About insetquotes: there must be a way to parametrize this instead of hardwiring the peculiarities of the French language... BTW this actually works (for me) :-) - Martin
Index: ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v retrieving revision 1.1987 diff -u -r1.1987 ChangeLog --- ChangeLog 5 Oct 2004 13:18:28 -0000 1.1987 +++ ChangeLog 7 Oct 2004 13:18:55 -0000 @@ -1,3 +1,7 @@ +2004-10-07 Martin Vermeer <[EMAIL PROTECTED]> + + * LaTeX.C: implement use of babel language in xindy. + 2004-10-05 José Matos <[EMAIL PROTECTED]> * bufferparams.[Ch] (readBullets, readBulletsLaTeX): new methods. Index: LaTeX.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeX.C,v retrieving revision 1.103 diff -u -r1.103 LaTeX.C --- LaTeX.C 5 Oct 2004 10:11:26 -0000 1.103 +++ LaTeX.C 7 Oct 2004 13:18:55 -0000 @@ -44,6 +44,7 @@ using lyx::support::QuoteName; using lyx::support::rtrim; using lyx::support::split; +using lyx::support::subst; using lyx::support::suffixIs; using lyx::support::Systemcall; using lyx::support::unlink; @@ -274,7 +275,7 @@ // no checks for now lyxerr[Debug::LATEX] << "Running MakeIndex." << endl; message(_("Running MakeIndex.")); - rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx"))); + rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")), runparams); } // run bibtex @@ -342,7 +343,7 @@ // no checks for now lyxerr[Debug::LATEX] << "Running MakeIndex." << endl; message(_("Running MakeIndex.")); - rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx"))); + rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")), runparams); } // 2 @@ -393,12 +394,13 @@ } -bool LaTeX::runMakeIndex(string const & f) +bool LaTeX::runMakeIndex(string const & f, OutputParams const runparams) { lyxerr[Debug::LATEX] << "idx file has been made," " running makeindex on file " << f << endl; string tmp = lyxrc.index_command + " "; + tmp = subst(tmp, "$$lang", runparams.document_language); tmp += QuoteName(f); Systemcall one; one.startscript(Systemcall::Wait, tmp); Index: LaTeX.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeX.h,v retrieving revision 1.42 diff -u -r1.42 LaTeX.h --- LaTeX.h 26 Sep 2004 14:19:46 -0000 1.42 +++ LaTeX.h 7 Oct 2004 13:18:55 -0000 @@ -155,7 +155,7 @@ void deplog(DepTable & head); /// - bool runMakeIndex(std::string const &); + bool runMakeIndex(std::string const &, OutputParams const); /// std::vector<Aux_Info> const scanAuxFiles(std::string const &); Index: converter.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/converter.C,v retrieving revision 1.99 diff -u -r1.99 converter.C --- converter.C 25 Jul 2004 00:04:40 -0000 1.99 +++ converter.C 7 Oct 2004 13:18:55 -0000 @@ -18,6 +18,7 @@ #include "debug.h" #include "format.h" #include "gettext.h" +#include "language.h" #include "LaTeX.h" #include "frontends/Alert.h" @@ -290,7 +291,6 @@ } OutputParams runparams; runparams.flavor = getFlavor(edgepath); - string path = OnlyPath(from_file); Path p(path); @@ -531,6 +531,8 @@ { buffer.busy(true); buffer.message(_("Running LaTeX...")); + + runparams.document_language = buffer.params().language->babel(); // do the LaTeX run(s) string name = buffer.getLatexName(); Index: outputparams.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/outputparams.h,v retrieving revision 1.8 diff -u -r1.8 outputparams.h --- outputparams.h 16 Aug 2004 00:32:00 -0000 1.8 +++ outputparams.h 7 Oct 2004 13:18:56 -0000 @@ -58,7 +58,11 @@ /** the babel name of the language at the point where the inset is */ - std::string lang; + std::string local_language; + + /** Document language babel name + */ + mutable std::string document_language; /** free_spacing == true means that the inset is in a free-spacing paragraph. Index: paragraph.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v retrieving revision 1.379 diff -u -r1.379 paragraph.C --- paragraph.C 5 Oct 2004 10:11:28 -0000 1.379 +++ paragraph.C 7 Oct 2004 13:18:56 -0000 @@ -1031,7 +1031,7 @@ OutputParams rp = runparams; rp.moving_arg = moving_arg; rp.free_spacing = style->free_spacing; - rp.lang = font.language()->babel(); + rp.local_language = font.language()->babel(); rp.intitle = style->intitle; pimpl_->simpleTeXSpecialChars(buf, bparams, os, texrow, rp, Index: insets/insetquotes.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetquotes.C,v retrieving revision 1.117 diff -u -r1.117 insetquotes.C --- insets/insetquotes.C 5 Oct 2004 12:56:22 -0000 1.117 +++ insets/insetquotes.C 7 Oct 2004 13:18:57 -0000 @@ -270,13 +270,13 @@ string qstr; if (language_ == FrenchQ && times_ == DoubleQ - && runparams.lang == "frenchb") { + && runparams.local_language == "frenchb") { if (side_ == LeftQ) qstr = "\\og "; //the spaces are important here else qstr = " \\fg{}"; //and here } else if (language_ == FrenchQ && times_ == DoubleQ - && runparams.lang == "french") { + && runparams.local_language == "french") { if (side_ == LeftQ) qstr = "<< "; //the spaces are important here else
signature.asc
Description: This is a digitally signed message part