diff --git a/src/tex2lyx/Preamble.h b/src/tex2lyx/Preamble.h index 9b15a3fea0..8372fcb33c 100644 --- a/src/tex2lyx/Preamble.h +++ b/src/tex2lyx/Preamble.h @@ -39,6 +39,8 @@ public: /// std::string notefontcolor() const { return h_notefontcolor; } /// + std::string language() const { return h_language; } + /// std::string use_indices() const { return h_use_indices; } /// bool indentParagraphs() const; diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp index 5b91e1842d..3acc0e7a22 100644 --- a/src/tex2lyx/tex2lyx.cpp +++ b/src/tex2lyx/tex2lyx.cpp @@ -681,6 +681,10 @@ bool tex2lyx(idocstream & is, ostream & os, string encoding) active_environments.push_back("document"); Context context(true, textclass); stringstream ss; + // store the document language in the context to be able to handle the + // commands like \foreignlanguage and \textenglish etc. + context.font.language = preamble.language(); + // parse the main text parse_text(p, ss, FLAG_END, true, context); if (Context::empty) // Empty document body. LyX needs at least one paragraph. diff --git a/status.20x b/status.20x index 4ce7367d02..0742baa56f 100644 --- a/status.20x +++ b/status.20x @@ -84,6 +84,7 @@ What's new * TEX2LYX +- Fix bug that language change was not recognized (bug 8210). * ADVANCED FIND AND REPLACE