diff options
Diffstat (limited to 'src/sisudoc/ocda/io_in/paths_source.d')
| -rw-r--r-- | src/sisudoc/ocda/io_in/paths_source.d | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sisudoc/ocda/io_in/paths_source.d b/src/sisudoc/ocda/io_in/paths_source.d index 9cacdf0..f32b89e 100644 --- a/src/sisudoc/ocda/io_in/paths_source.d +++ b/src/sisudoc/ocda/io_in/paths_source.d @@ -298,6 +298,21 @@ template PathMatters() { string language() { return lng(); } + /+ ↓ the same language, as a language tag rather than as spine's + own code. Spine names a language the way a 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; + an underscore there is invalid and every xhtml file in the + document carrying it is an epubcheck error. Every other code + spine knows (from the document sample set) is two letters, + where the two forms are equal, which is why only a region + code shows this up. + +/ + string language_tag() { + import std.array : replace; + return lng().replace("_", "-"); + } string file_with_absolute_path() { return _env["pwd"].chainPath(path_and_fn).array; } |
