From: Juergen Spitzmueller Date: Mon, 11 Mar 2019 09:56:12 +0000 (+0100) Subject: Prevent multiple insertion of language switch at document body X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=113b5d8489c041f1c4d6602c5a77b48b320285f2;p=features.git Prevent multiple insertion of language switch at document body --- 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",