diff --git a/src/Font.cpp b/src/Font.cpp index 6b072d8b67..1a4e77464d 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -707,7 +707,7 @@ void Font::validate(LaTeXFeatures & features) const // FIXME: Do something for background and soul package? if (((features.usePolyglossia() && lang_->polyglossia() != doc_language->polyglossia()) - || (features.useBabel(true) && lang_->babel() != doc_language->babel())) + || (features.useBabel() && lang_->babel() != doc_language->babel())) && lang_ != ignore_language && lang_ != latex_language) { diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 37c2e78900..9a73c8e21e 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -327,7 +327,7 @@ LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p, {} -LaTeXFeatures::LangPackage LaTeXFeatures::langPackage(bool englishbabel) const +LaTeXFeatures::LangPackage LaTeXFeatures::langPackage() const { string const local_lp = bufferParams().lang_package; @@ -347,9 +347,6 @@ LaTeXFeatures::LangPackage LaTeXFeatures::langPackage(bool englishbabel) const * If babel is selected (either directly or via the "auto" * mechanism), we really do only require it if we have * a language that needs it. - * English alone normally does not require babel (since it is - * the default language of LaTeX). However, in some cases we - * need to surpass this exception (see Font::validate). */ bool const polyglossia_required = isRequired("polyglossia") @@ -357,8 +354,7 @@ LaTeXFeatures::LangPackage LaTeXFeatures::langPackage(bool englishbabel) const && !isProvided("babel") && this->hasOnlyPolyglossiaLanguages(); bool const babel_required = - ((englishbabel || bufferParams().language->lang() != "english") - && !bufferParams().language->babel().empty()) + !bufferParams().language->babel().empty() || !this->getBabelLanguages().empty(); if (local_lp == "auto") { diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h index 46608fd73d..71004be4ca 100644 --- a/src/LaTeXFeatures.h +++ b/src/LaTeXFeatures.h @@ -138,9 +138,9 @@ public: /** Which language package do we require? \p englishbabel determines * if we require babel even if English is the only language. */ - LangPackage langPackage(bool englishbabel = false) const; + LangPackage langPackage() const; /// Convenience function to test if we use babel - bool useBabel(bool englishbabel = false) const { return langPackage(englishbabel) == LANG_PACK_BABEL; } + bool useBabel() const { return langPackage() == LANG_PACK_BABEL; } /// Convenience function to test if we use polyglossia bool usePolyglossia() const { return langPackage() == LANG_PACK_POLYGLOSSIA; } /// are we in a float?