]> git.lyx.org Git - features.git/commitdiff
LyXHTML: give the language in the root tag.
authorThibaut Cuvelier <tcuvelier@lyx.org>
Fri, 23 Dec 2022 01:12:05 +0000 (02:12 +0100)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Sun, 25 Dec 2022 19:48:14 +0000 (20:48 +0100)
src/Buffer.cpp

index 94f4dd477c4fc86b0f2b2cf7bd697313d87515e0..c7e479a489f0bb89988a5ecf3c08c2563db28ef6 100644 (file)
@@ -2173,8 +2173,7 @@ Buffer::ExportStatus Buffer::writeDocBookSource(odocstream & os,
                }
 
                // Directly output the root tag, based on the current type of document.
-               string languageCode = params().language->code();
-               string params = "xml:lang=\"" + languageCode + '"'
+               string params = "xml:lang=\"" + params().language->code() + '"'
                                                + " xmlns=\"http://docbook.org/ns/docbook\""
                                                + " xmlns:xlink=\"http://www.w3.org/1999/xlink\""
                                                + mathmlNamespace
@@ -2241,8 +2240,7 @@ Buffer::ExportStatus Buffer::writeLyXHTMLSource(odocstream & os,
        if (output_preamble) {
                os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
                   << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\" \"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd\">\n"
-                  // FIXME Language should be set properly.
-                  << "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
+                  << "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"" << from_ascii(params().language->code()) << "\">\n"
                   << "<head>\n"
                   << "<meta name=\"GENERATOR\" content=\"" << PACKAGE_STRING << "\" />\n"
                   // FIXME Presumably need to set this right