Decide whether a document can carry prose in more than one language #7

Open
opened 2026-09-12 02:38:52 +09:00 by natsukium · 1 comment
Owner

A doc comment holds one piece of prose in one language, and the renderer emits
one page per source file. A repository that documents itself in two languages
has nowhere to put the second.

natsukium/dotfiles does exactly this today, in the workflow gloss would
replace: configuration.org and configuration.ja.org kept in step by po4a
against po/ja.po.

Whether this belongs in gloss at all is the question. A doc comment is part of
the source file, so a second language means either two comments per node or an
external catalogue keyed by node — and the second reintroduces the drift
between prose and code that being code-first exists to remove. Worth a design
note before any implementation.

A doc comment holds one piece of prose in one language, and the renderer emits one page per source file. A repository that documents itself in two languages has nowhere to put the second. natsukium/dotfiles does exactly this today, in the workflow gloss would replace: `configuration.org` and `configuration.ja.org` kept in step by po4a against `po/ja.po`. Whether this belongs in gloss at all is the question. A doc comment is part of the source file, so a second language means either two comments per node or an external catalogue keyed by node — and the second reintroduces the drift between prose and code that being code-first exists to remove. Worth a design note before any implementation.
Author
Owner

Decision: gloss stays monolingual per source file. A second doc comment per node or a catalogue keyed by node would reintroduce the drift that being code-first exists to remove.

What it will support instead, as a late step: a gettext catalogue at the render layer, keyed by the prose segment's own text (msgid). The renderer, given a .po, substitutes translated prose per segment and emits a second page (*.ja.html). Because the key is the English text, a changed comment surfaces as fuzzy/untranslated in the usual gettext way instead of drifting silently. This is the same mechanism as the current po4a workflow, applied to prose segments rather than whole files. No implementation until the rest of the pipeline has settled; the requirement for now is only that prose segments remain addressable as text.

Decision: gloss stays monolingual per source file. A second doc comment per node or a catalogue keyed by node would reintroduce the drift that being code-first exists to remove. What it will support instead, as a late step: a gettext catalogue at the render layer, keyed by the prose segment's own text (msgid). The renderer, given a `.po`, substitutes translated prose per segment and emits a second page (`*.ja.html`). Because the key is the English text, a changed comment surfaces as fuzzy/untranslated in the usual gettext way instead of drifting silently. This is the same mechanism as the current po4a workflow, applied to prose segments rather than whole files. No implementation until the rest of the pipeline has settled; the requirement for now is only that prose segments remain addressable as text.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
natsukium/gloss#7
No description provided.