aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/default_paths.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/default_paths.org')
-rw-r--r--org/default_paths.org15
1 files changed, 15 insertions, 0 deletions
diff --git a/org/default_paths.org b/org/default_paths.org
index a6cf19a..15f196f 100644
--- a/org/default_paths.org
+++ b/org/default_paths.org
@@ -310,6 +310,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;
}