texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Always add a language information in EPUB


From: Patrice Dumas
Subject: branch master updated: Always add a language information in EPUB
Date: Thu, 04 Aug 2022 05:45:10 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new e5ed39c738 Always add a language information in EPUB
e5ed39c738 is described below

commit e5ed39c73864b35e3346b963f4e92b05e2e6357d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Aug 4 11:44:59 2022 +0200

    Always add a language information in EPUB
    
    * tp/ext/epub3.pm: add en language if there is no @documentlanguage,
    as mandated by the standard.
---
 ChangeLog                                           |  7 +++++++
 tp/ext/epub3.pm                                     | 21 ++++++++++++++++-----
 .../EPUB/os\303\251_utf8.opf"                       |  1 +
 .../formatting_epub_package/EPUB/formatting.opf     |  7 ++++---
 .../formatting_epub_package/EPUB/formatting.opf     |  7 ++++---
 5 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d3b7475687..5fc92df0f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-08-04  Patrice Dumas  <pertusus@free.fr>
+
+       Always add a language information in EPUB
+
+       * tp/ext/epub3.pm: add en language if there is no @documentlanguage,
+       as mandated by the standard.
+
 2022-08-03  Patrice Dumas  <pertusus@free.fr>
 
        Copy image files in subdirectories directly in EPUB images
diff --git a/tp/ext/epub3.pm b/tp/ext/epub3.pm
index 0278a9030f..c5fcba68bf 100644
--- a/tp/ext/epub3.pm
+++ b/tp/ext/epub3.pm
@@ -605,9 +605,16 @@ EOT
   my $unique_uid = 'texi-uid';
   # TODO to discuss on bug-texinfo
   my $identifier = 'texinfo:'.$document_name;
-  # also to discuss
+  # FIXME the dcterms:modified is mandatory, and it is also mandatory that it 
is a date:
+  #  each Rendition MUST include exactly one [DCTERMS] modified property 
containing its last modification date. The value of this property MUST be an 
[XMLSCHEMA-2] dateTime conformant date of the form:
+
+  # CCYY-MM-DDThh:mm:ssZ
+  #
+  # The last modification date MUST be expressed in Coordinated Universal Time 
(UTC) and MUST be terminated by the "Z" (Zulu) time zone indicator.
+  #
   # <meta property="dcterms:modified">2012-03-05T12:47:00Z</meta>
-  # also <dc:rights>
+  # to discuss
+  # <dc:rights>
   my $opf_file_path_name = File::Spec->catfile($epub_destination_directory,
                                         $epub_document_dir_name, 
$opf_filename);
   my ($encoded_opf_file_path_name, $opf_path_encoding)
@@ -654,11 +661,15 @@ EOT
       }
     }
   }
-  foreach my $author (@authors) {
-    print $opf_fh "<dc:creator>$author</dc:creator>\n";
+  # at least one language specifier is mandated by the standard
+  if (scalar(@languages) == 0) {
+    @languages = ('en');
   }
   foreach my $language (@languages) {
-    print $opf_fh "<dc:language>$language</dc:language>\n";
+    print $opf_fh "      <dc:language>$language</dc:language>\n";
+  }
+  foreach my $author (@authors) {
+    print $opf_fh "      <dc:creator>$author</dc:creator>\n";
   }
   print $opf_fh <<EOT;
    </metadata>
diff --git 
"a/tp/tests/formatting/res_parser/non_ascii_test_epub/os\303\251_utf8_epub_package/EPUB/os\303\251_utf8.opf"
 
"b/tp/tests/formatting/res_parser/non_ascii_test_epub/os\303\251_utf8_epub_package/EPUB/os\303\251_utf8.opf"
index c2704580c2..6609828ba8 100644
--- 
"a/tp/tests/formatting/res_parser/non_ascii_test_epub/os\303\251_utf8_epub_package/EPUB/os\303\251_utf8.opf"
+++ 
"b/tp/tests/formatting/res_parser/non_ascii_test_epub/os\303\251_utf8_epub_package/EPUB/os\303\251_utf8.opf"
@@ -3,6 +3,7 @@
    <metadata xmlns:dc="http://purl.org/dc/elements/1.1/";>
       <dc:identifier id="texi-uid">texinfo:osé_utf8</dc:identifier>
       <dc:title>Tôp</dc:title>
+      <dc:language>en</dc:language>
    </metadata>
    <manifest>
       <item id="nav" properties="nav" media-type="application/xhtml+xml" 
href="xhtml/nav_toc.xhtml"/>
diff --git 
a/tp/tests/layout/res_parser/formatting_epub/formatting_epub_package/EPUB/formatting.opf
 
b/tp/tests/layout/res_parser/formatting_epub/formatting_epub_package/EPUB/formatting.opf
index 22b3de947d..3abe7cae40 100644
--- 
a/tp/tests/layout/res_parser/formatting_epub/formatting_epub_package/EPUB/formatting.opf
+++ 
b/tp/tests/layout/res_parser/formatting_epub/formatting_epub_package/EPUB/formatting.opf
@@ -3,9 +3,10 @@
    <metadata xmlns:dc="http://purl.org/dc/elements/1.1/";>
       <dc:identifier id="texi-uid">texinfo:formatting</dc:identifier>
       <dc:title>title -a</dc:title>
-<dc:creator>author1 -a with accents in name Te'c,a</dc:creator>
-<dc:creator>author2 -a</dc:creator>
-<dc:creator>author</dc:creator>
+      <dc:language>en</dc:language>
+      <dc:creator>author1 -a with accents in name Te'c,a</dc:creator>
+      <dc:creator>author2 -a</dc:creator>
+      <dc:creator>author</dc:creator>
    </metadata>
    <manifest>
       <item id="nav" properties="nav" media-type="application/xhtml+xml" 
href="xhtml/nav_toc.xhtml"/>
diff --git 
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/formatting.opf
 
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/formatting.opf
index 59769648d4..41d4e98a7f 100644
--- 
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/formatting.opf
+++ 
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/formatting.opf
@@ -3,9 +3,10 @@
    <metadata xmlns:dc="http://purl.org/dc/elements/1.1/";>
       <dc:identifier id="texi-uid">texinfo:formatting</dc:identifier>
       <dc:title>title -a</dc:title>
-<dc:creator>author1 -a with accents in name Te'c,a</dc:creator>
-<dc:creator>author2 -a</dc:creator>
-<dc:creator>author</dc:creator>
+      <dc:language>en</dc:language>
+      <dc:creator>author1 -a with accents in name Te'c,a</dc:creator>
+      <dc:creator>author2 -a</dc:creator>
+      <dc:creator>author</dc:creator>
    </metadata>
    <manifest>
       <item id="nav" properties="nav" media-type="application/xhtml+xml" 
href="xhtml/nav_toc.xhtml"/>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]