diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-21 10:04:40 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-22 14:08:10 -0400 |
| commit | a32230d9ede2cf3a4f85547e6793b8918c72af30 (patch) | |
| tree | 6ec0c07713f6c84f5bcbc5414fb376f9b493c654 /org | |
| parent | pod: set entry limit for the writer and reader (diff) | |
pod: carry tools/po4a, the translation working set
A pod now carries its catalogues, so a translation can be updated
rather than only retyped: providing the .pot and .po (the means of
maintaining it).
A directory walk, where every other thing the pod writer carries is
named. A catalogue set is whatever the translator has, and enumerating
.pot and .po files would mean the writer deriving the document's
languages a second time, from a second place, to say what it already
reads from the manifest.
Done once, on the last language, as the markup blocks are. The tree is
not language specific, so a pass for each language would re-read all of
it, 5.5 MB ten times over for live-manual, into an archive the next pass
overwrites.
Every name is checked before it is carried, by the rule the pod reader
applies to an archive it is handed. The writer is reading a directory
someone else may have filled, which is the reason the reader checks.
The cost is small, and it is the whole argument for compressing the
archive as a stream rather than per member:
uncompressed content 6972418 -> 13167489 +89%
the .sisupod 692942 -> 891388 +28.6%
5.5 MB of catalogues cost 198 KB, because the .po files largely repeat
markup already in the archive and whole-stream compression sees it.
Per-member deflate could not.
(assisted by Claude-Code)
Diffstat (limited to 'org')
| -rw-r--r-- | org/config_nix.org | 2 | ||||
| -rw-r--r-- | org/out_src_pod.org | 41 |
2 files changed, 43 insertions, 0 deletions
diff --git a/org/config_nix.org b/org/config_nix.org index 6fb82ad..f2bc085 100644 --- a/org/config_nix.org +++ b/org/config_nix.org @@ -312,6 +312,8 @@ texliveFull # NOT texlive.combined.scheme-full: deprecated, file # what a file is coreutils # sha256sum and numfmt guaranteed, for checking a digests.txt line by hand + po4a + gettext ]; }; }); diff --git a/org/out_src_pod.org b/org/out_src_pod.org index 7efc52a..8668078 100644 --- a/org/out_src_pod.org +++ b/org/out_src_pod.org @@ -127,6 +127,7 @@ import std.zip; import std.conv : to; import sisudoc.ocda.meta.rgx_files; import sisudoc.outputs.io_out; +import sisudoc.ocda.io_in.carried_names; import sisudoc.outputs.io_out.zip_pod; import sisudoc.outputs.io_out.xmls; #+END_SRC @@ -290,6 +291,46 @@ auto pod_zipMakeReady(M,P,S)(M doc_matters, P pths_pod, S _st) { writeln("WARNING (io) src out NOT found (document make): ", fn_src_in); } } + } { /+ ↓ bundle tools/po4a, the translation working set + . + A directory walk, where every other thing the pod writer carries + is named. A catalogue set is whatever the translator has, and + naming .pot and .po files would mean the writer knowing the + document's languages a second time, from a second place, to say + what it already reads from the manifest. + . + Done once, on the last language, as the markup blocks are. + . + Every name is checked before it is carried, by the rule the pod + reader applies to an archive it is handed. The writer is reading a + directory someone else may have filled. + +/ + if (doc_matters.src.is_pod + && doc_matters.src.language == doc_matters.pod.manifest_list_of_languages[$-1] + ) { + mixin spineCarriedNames; + enum string _po4a_root = "tools/po4a"; + string _tools_in = doc_matters.pod.manifest_path ~ "/" ~ _po4a_root; + if (exists(_tools_in) && _tools_in.isDir) { + foreach (string _f; dirEntries(_tools_in, SpanMode.depth)) { + if (!(_f.isFile)) { continue; } + string _rel = _po4a_root ~ "/" ~ _f[(_tools_in.length + 1) .. $]; + string _bad = validateCarriedPath(_rel); + if (_bad.length > 0) { + writeln("WARNING not carried into the pod: ", _bad); + continue; + } + if (doc_matters.opt.action.source_or_pod) { + string _out_fs = pths_pod.pod_root(doc_matters.src.filename) + .filesystem_open_zpod.to!string ~ "/" ~ _rel; + string _parent = _out_fs.dirName; + if (!exists(_parent)) { _parent.mkdirRecurse; } + _f.copy(_out_fs); + zip = podArchive("file_path_bin", _f, "pod/" ~ _rel, zip); + } + } + } + } } { // pod manifest auto fn_src_in = doc_matters.src.file_with_absolute_path.to!string; auto fn_src_out_pod_zip_base |
