mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Load babel with English-only documents (bug 8423)
This commit is contained in:
parent
25e4bf4b27
commit
0dd741e4da
@ -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)
|
||||
{
|
||||
|
@ -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") {
|
||||
|
@ -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?
|
||||
|
Loading…
Reference in New Issue
Block a user