From cd93d2d8b5062493650673ecdd13139d6f0e5171 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 20 Sep 2026 23:43:35 -0400 Subject: xml: markup language attributes take a bcp 47 tag Spine names a language as the directory under media/text/ is named, which for a region is the posix form with an underscore, pt_BR. A lang, xml:lang or dc:language value is a BCP 47 (RFC 3066) tag and wants a hyphen, pt-BR. Spine put its own code there unchanged, so a document in a region language produced an invalid attribute in every one of its xhtml files: 138 epubcheck errors for a document of ten segments and a navigation file. src.language_tag is the same language as a tag. The attributes and the dc metadata now read it. Output paths keep src.language, since a path is named after the directory, not after the tag. (assisted by Claude-Code) --- src/sisudoc/outputs/io_out/epub3.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sisudoc/outputs/io_out/epub3.d') diff --git a/src/sisudoc/outputs/io_out/epub3.d b/src/sisudoc/outputs/io_out/epub3.d index 8a3baaf..c785895 100644 --- a/src/sisudoc/outputs/io_out/epub3.d +++ b/src/sisudoc/outputs/io_out/epub3.d @@ -298,7 +298,7 @@ template outputEPub3() { ┃", - doc.matters.src.language, + doc.matters.src.language_tag, _uuid, xhtml_format.special_characters_plain(doc.matters.conf_make_meta.meta.title_main), (doc.matters.conf_make_meta.meta.title_sub.empty) ? "" : format( @@ -309,7 +309,7 @@ template outputEPub3() { ? "" : xhtml_format.special_characters_plain(doc.matters.conf_make_meta.meta.creator_author), (doc.matters.conf_make_meta.meta.creator_author_surname_fn.empty) ? "" : xhtml_format.special_characters_plain(doc.matters.conf_make_meta.meta.creator_author_surname_fn), - doc.matters.src.language, // language, fix (needed in dochead metadata) + doc.matters.src.language_tag, // language, fix (needed in dochead metadata) (doc.matters.conf_make_meta.meta.date_published.empty) ? "" : xhtml_format.special_characters_plain_date(doc.matters.conf_make_meta.meta.date_published), (doc.matters.conf_make_meta.meta.rights_copyright.empty) -- cgit v1.2.3