[LyX/2.5.x] (Un)set document language explicitly only in main document, not children

Juergen Spitzmueller <[email protected]>
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit dbd74a8c460e16109710d9f8788a001bde5e8cb8
Author: Juergen Spitzmueller <[email protected]>
Date:   Thu Mar 19 11:46:38 2026 +0100

    (Un)set document language explicitly only in main document, not children
    
    (cherry picked from commit e697d651257b46b4428970ba91820b126af7bd32)
---
 src/output_latex.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/output_latex.cpp b/src/output_latex.cpp
index 0ee6bd133b..33f7cd47c9 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -1692,7 +1692,7 @@ void latexParagraphs(Buffer const & buf,
 	bool const using_begin_end = runparams.use_polyglossia ||
 					!lang_end_command.empty();
 
-	if (maintext && !lyxrc.language_auto_begin &&
+	if (maintext && !is_child && !lyxrc.language_auto_begin &&
 	    !mainlang.empty()) {
 		// FIXME UNICODE
 		string bc = runparams.use_polyglossia ?
@@ -1848,8 +1848,8 @@ void latexParagraphs(Buffer const & buf,
 	// but only if the last par is in a babel or polyglossia language
 	Language const * const lastpar_language =
 			paragraphs.at(lastpit).getParLanguage(bparams);
-	if (maintext && !lyxrc.language_auto_end && !mainlang.empty() &&
 		lastpar_language->encoding()->package() != Encoding::CJK) {
+	if (maintext && !is_child && !lyxrc.language_auto_end && !mainlang.empty() &&
 		os << from_utf8(subst(lang_end_command,
 					"$$lang",
 					mainlang))
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.