On Thu, 2004-10-07 at 08:23, Martin Vermeer wrote:

...

> OK, this should be the real patch now. I checked by saving 
> to 'drafts' and opening it there... Why is runparams.lang 
> empty no matter what I do?

Attached a worked-on patch that actually does the job, along the lines
you and Jean-Marc suggested. Is this okay?

- 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 08:38:50 -0000
@@ -1,3 +1,7 @@
+2004-10-06  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 08:38:50 -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 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.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 08:38:50 -0000
@@ -155,7 +155,7 @@
 	void deplog(DepTable & head);
 
 	///
-	bool runMakeIndex(std::string const &);
+	bool runMakeIndex(std::string const &, OutputParams);
 
 	///
 	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 08:38:50 -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);
 
@@ -527,10 +527,12 @@
 
 
 bool Converters::runLaTeX(Buffer const & buffer, string const & command,
-			  OutputParams const & runparams)
+			  OutputParams & runparams)
 {
 	buffer.busy(true);
 	buffer.message(_("Running LaTeX..."));
+	
+	string runparams.language = buffer.params().language->babel();
 
 	// do the LaTeX run(s)
 	string name = buffer.getLatexName();
Index: converter.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/converter.h,v
retrieving revision 1.37
diff -u -r1.37 converter.h
--- converter.h	13 May 2004 11:21:58 -0000	1.37
+++ converter.h	7 Oct 2004 08:38:50 -0000
@@ -136,7 +136,7 @@
 		     std::string const & filename);
 	///
 	bool runLaTeX(Buffer const & buffer, std::string const & command,
-		      OutputParams const &);
+		      OutputParams &);
 	///
 	ConverterList converterlist_;
 	///
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 08:38:50 -0000
@@ -60,6 +60,10 @@
 	 */
 	std::string lang;
 
+	/** Document language babel name
+	 */	
+	std::string language;
+
 	/** free_spacing == true means that the inset is in a free-spacing
 	    paragraph.
 	*/

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to