]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/tex2lyx.cpp
tex2lyx: fix a regression
[lyx.git] / src / tex2lyx / tex2lyx.cpp
index 37bcf7d038d9e76edf47d7bd90cacac9f7f5bb84..a7f83c25a34c41c449753b3b080e301cc7ea21f2 100644 (file)
@@ -333,6 +333,7 @@ bool noweb_mode = false;
 bool pdflatex = false;
 bool xetex = false;
 bool have_CJK = false;
+bool is_nonCJKJapanese = false;
 bool roundtrip = false;
 
 
@@ -670,6 +671,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.