From 8bfe3d71986d207c27b1a73b8d8d15e2648e820c Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 31 Aug 2019 11:20:10 +0200 Subject: [PATCH] lyx2lyx: Fix revert_new_languages --- lib/lyx2lyx/lyx_2_4.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py index 1f9924a984..5b1a87c2c9 100644 --- a/lib/lyx2lyx/lyx_2_4.py +++ b/lib/lyx2lyx/lyx_2_4.py @@ -1882,8 +1882,9 @@ def revert_new_languages(document): i = find_token(document.body, "\\lang", i+1) if i == -1: break - if document.body[i][6:].strip() in new_languages: - used_languages.add(document.language) + val = get_value(document.body, "\\lang", i) + if val in new_languages: + used_languages.add(val) # Korean is already supported via CJK, so leave as-is for Babel if ("korean" in used_languages @@ -1893,7 +1894,7 @@ def revert_new_languages(document): used_languages.discard("korean") for lang in used_languages: - revert(lang, *new_languages[lang]) + revert_language(document, lang, new_languages[lang][0], new_languages[lang][1]) gloss_inset_def = [