]> git.lyx.org Git - lyx.git/commitdiff
Amend fc605cf138c
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 25 Aug 2024 16:01:26 +0000 (18:01 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 25 Aug 2024 16:01:26 +0000 (18:01 +0200)
Use proper option if main and a secondary language have BabelProvide 2

lib/languages
src/BufferParams.cpp

index 868bde49de46027e6a5db7f89e660394d8bee404..d5ac3bd699d0b1e55f95743558f804057827ef74 100644 (file)
 #   if a corresponding language module exists.
 # * BabelProvide determines if and when a language should be loaded from
 #   babel *.ini files with babel. Possible values:
-#   0 (= never, default), 1 (always), 2 (with Unicode engines/non-TeX fonts)
+#   0 (= never, default), 1 (always), 2 (with Unicode engines/non-TeX fonts).
+#   The latter advises babel to ignore existing *.ldf files.
 # * BabelOpts are comma separated, no matter how they shall be represented
 #   in the output.
 # * BabelOptFormat specifies how the language-specific options shall be
index f82fd1d24c2dd966f9028fdecec75ee779eb592b..8f5dbfdcac531f4ec0204c5094c05705c9f18834 100644 (file)
@@ -3502,6 +3502,7 @@ string BufferParams::babelCall(LaTeXFeatures const & features, string lang_opts,
        langs.insert(language);
        ostringstream os;
        string force_provide;
+       bool have_main_forceprovide = false;
        for (auto const & l : langs) {
                string blang = l->babel();
                bool use_opt = langoptions;
@@ -3534,12 +3535,15 @@ string BufferParams::babelCall(LaTeXFeatures const & features, string lang_opts,
                if (bp == 2 && useNonTeXFonts) {
                        // here we need to tell babel to use the ini
                        // even though an *.ldf exists
-                       if (l == language)
+                       if (l == language) {
                                force_provide = force_provide.empty()
                                                ? "provide=*"
                                                : "provide*=*";
-                       else
-                               force_provide = "provide+=*";
+                               have_main_forceprovide = true;
+                       } else
+                               force_provide = have_main_forceprovide
+                                               ? "provide*=*"
+                                               : "provide+=*";
                        have_mods = true;
                }
                if (bp != 1 && use_opt)