Implement use of babel language in xindy.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9061 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2004-10-07 15:21:03 +00:00
parent 8f4d5e8096
commit a566db1d51
7 changed files with 21 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2004-10-07 Martin Vermeer <martin.vermeer@hut.fi>
* LaTeX.C: implement use of babel language in xindy.
2004-10-05 José Matos <jamatos@lyx.org>
* bufferparams.[Ch] (readBullets, readBulletsLaTeX): new methods.

View File

@ -44,6 +44,7 @@ using lyx::support::prefixIs;
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 @@ int LaTeX::run(TeXErrors & terr)
// 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 @@ int LaTeX::run(TeXErrors & terr)
// 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 @@ int LaTeX::startscript()
}
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);

View File

@ -155,7 +155,7 @@ private:
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 &);

View File

@ -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 @@ bool Converters::convert(Buffer const * buffer,
}
OutputParams runparams;
runparams.flavor = getFlavor(edgepath);
string path = OnlyPath(from_file);
Path p(path);
@ -531,6 +531,8 @@ bool Converters::runLaTeX(Buffer const & buffer, string const & command,
{
buffer.busy(true);
buffer.message(_("Running LaTeX..."));
runparams.document_language = buffer.params().language->babel();
// do the LaTeX run(s)
string name = buffer.getLatexName();

View File

@ -270,13 +270,13 @@ int InsetQuotes::latex(Buffer const &, ostream & os,
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

View File

@ -58,7 +58,11 @@ struct OutputParams {
/** 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.

View File

@ -1031,7 +1031,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
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,