From 113b5d8489c041f1c4d6602c5a77b48b320285f2 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 11 Mar 2019 10:56:12 +0100 Subject: [PATCH] Prevent multiple insertion of language switch at document body --- lib/lyx2lyx/lyx2lyx_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lyx2lyx/lyx2lyx_tools.py b/lib/lyx2lyx/lyx2lyx_tools.py index 4177ef8e47..0c32519702 100644 --- a/lib/lyx2lyx/lyx2lyx_tools.py +++ b/lib/lyx2lyx/lyx2lyx_tools.py @@ -747,7 +747,7 @@ def revert_language(document, lyxname, babelname, polyglossianame): # With babel, we need to add the language options if with_babel and (primary or secondary): insert_document_option(document, babelname) - if secondary: + if secondary and document.body[10] != "selectlanguage{%s}" % document.language: # Since the user options are always placed after the babel options, # we need to reset the main language document.body[2 : 2] = ["\\begin_layout Standard", -- 2.39.5