]> granicus.if.org Git - docbook-dsssl/commitdiff
Correctly set dc:language in OPF metadata when i18nizing. Closes Bug #2755150
authorKeith Fahlgren <abdelazer@users.sourceforge.net>
Sun, 12 Apr 2009 23:31:56 +0000 (23:31 +0000)
committerKeith Fahlgren <abdelazer@users.sourceforge.net>
Sun, 12 Apr 2009 23:31:56 +0000 (23:31 +0000)
xsl/epub/bin/spec/epub_regressions_spec.rb
xsl/epub/bin/spec/files/de.xml [new file with mode: 0644]
xsl/epub/docbook.xsl

index 516aeab6e0724bec68a95f1e7c6f7e72caf8e43a..aa98497c3c5fbc2b21301b298745fd190ad13135 100755 (executable)
@@ -128,6 +128,12 @@ describe DocBook::Epub do
     opf_lns.to_s.should_not =~ /opf:manifest/
   end
 
+  it "should use the @lang of the document being converted for the OPF metadata" do
+    opf_lns = opf_lines('de.xml', @filedir)
+    opf_lns.to_s.should =~ /language[^>]*>de</
+  end
+
+
   after(:all) do
     FileUtils.rm_r(@tmpdir, :force => true)
   end  
diff --git a/xsl/epub/bin/spec/files/de.xml b/xsl/epub/bin/spec/files/de.xml
new file mode 100644 (file)
index 0000000..52705af
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" 
+          "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+<article lang="de">
+  <articleinfo>
+    <title>Test file</title>
+
+    <date>2009-04-12</date>
+
+    <author>
+      <firstname>Michael</firstname>
+      <surname>Wiedmann</surname>
+    </author>
+
+    <publisher><publishername>Person</publishername></publisher>
+    <biblioid class="other">unique-doc-id</biblioid>
+
+    <copyright>
+      <year>2009</year>
+      <holder>Michael Wiedmann</holder>
+    </copyright>
+
+    <abstract id="abstract">
+      <para>some abstract</para>
+    </abstract>
+  </articleinfo>
+
+  <section>
+    <title>Title</title>
+    <para>foo foo</para>
+  </section>
+
+</article>
index 3a895b2f5ece1c276c442414e135289b857ae6ed..54664c8444adcad300c579e0dc7dc96af5952d1b 100644 (file)
             <xsl:apply-templates select="/*/*[contains(name(.), 'info')]/*"
                                  mode="opf.metadata"/>        
             <xsl:element name="dc:language">
-              <xsl:call-template name="l10n.language"/>
+              <xsl:call-template name="l10n.language">
+                <xsl:with-param name="target" select="/*"/>
+              </xsl:call-template>  
             </xsl:element>
 
             <xsl:if test="/*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]">