filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit 795f89c7d1e4ade6cdaa12cb4ba0857ae3b1e02e
Author:     Svante Schubert <[email protected]>
AuthorDate: Mon Aug 24 17:14:42 2020 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Tue Mar 2 13:22:03 2021 +0100

    HTML XSLT: Adding default language for accessiblity
    
    Change-Id: I1e608239bd2524f0d2372871f465d926ea24ba42
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111614
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl
index e81b93ce4235..196b85eae859 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl
@@ -145,7 +145,18 @@
     <xsl:template name="start-main">
         <xsl:param name="globalData" />
 
+        <xsl:variable name="lang">
+             <xsl:choose>
+                 <xsl:when 
test="$globalData/meta-file/*/office:meta/dc:language">
+                     <xsl:value-of 
select="$globalData/meta-file/*/office:meta/dc:language" />
+                 </xsl:when>
+                 <xsl:otherwise>en-US</xsl:otherwise>
+             </xsl:choose>
+        </xsl:variable>
+
         <xsl:element name="html">
+
+            <xsl:attribute name="lang"><xsl:value-of 
select="$lang"/></xsl:attribute>
             <xsl:comment>This file was converted to xhtml by LibreOffice - see 
https://cgit.freedesktop.org/libreoffice/core/tree/filter/source/xslt for the 
code.</xsl:comment>
             <xsl:call-template name='create-header'>
                 <xsl:with-param name="globalData" select="$globalData" />
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to