From ed7717fef53db3b3aa5593fbb2649313e75a0f31 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Fri, 24 Jul 2026 15:25:50 +0200 Subject: cli: --rand/--rand-v (random verse) + --rand-ch (random chapter) from the corpus, using the config default version; v0.16.0 --- internal/bible/booktable.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'internal/bible/booktable.go') diff --git a/internal/bible/booktable.go b/internal/bible/booktable.go index 9ec95be..ac7ea95 100644 --- a/internal/bible/booktable.go +++ b/internal/bible/booktable.go @@ -154,6 +154,15 @@ func (t *BookTable) shortcut(dialect, canonical string) string { return "" } +// Abbrev returns the dialect's primary abbreviation for a canonical book, +// falling back to the canonical name when the dialect has no entry. +func (t *BookTable) Abbrev(dialect, canonical string) string { + if a := t.shortcut(dialect, canonical); a != "" { + return a + } + return canonical +} + // FormatRef renders a canonical English reference ("John 20:1,11-18") in the // dialect's sigla: the dialect's book shortcut plus its number style -- English // "Jn 20:1,11-18" (colon chapter:verse, comma groups); Polish "J 20, 1. 11-18" -- cgit v1.3