diff options
Diffstat (limited to 'internal/render/render.go')
| -rw-r--r-- | internal/render/render.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/render/render.go b/internal/render/render.go index 7ba8ebd..6cdb939 100644 --- a/internal/render/render.go +++ b/internal/render/render.go @@ -65,6 +65,22 @@ func LocalizeHeading(heading, partID, lang string) string { return heading } +// HeadingWithRef returns a section's localised heading with its scripture +// reference appended in parentheses when the heading does not already carry +// one. The modern (niedziela) heading already embeds its citation -- e.g. +// "Ewangelia (J 20, 1. 11-18)" -- while the traditional (missalemeum) heading +// is a bare label ("Gospel"/"Ewangelia") with the reference only in +// sec.Citation; this appends it so every reading shows where it is from, +// uniformly across cli/tui/web. The citation is source-form (like the modern +// one), never translated. +func HeadingWithRef(sec liturgy.Section, lang string) string { + heading := LocalizeHeading(sec.Heading, sec.PartID, lang) + if sec.Citation != "" && !strings.Contains(heading, "(") { + heading += " (" + sec.Citation + ")" + } + return heading +} + // versionSystem maps a bible version to the Psalter system bible.ToEnglishRef // expects: vul/grb/wuj follow the Vulgate/Septuagint numbering, drb follows // the Hebrew chapter with the DRB title-fold verse shift. Ported from |
