aboutsummaryrefslogtreecommitdiff
path: root/internal/bible/booktable.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 15:25:50 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 15:25:50 +0200
commited7717fef53db3b3aa5593fbb2649313e75a0f31 (patch)
tree023601285808a4704f5646bf6e4777beea6dd93a /internal/bible/booktable.go
parent1e4939874a14d8abb13e82b2273bfc5f9d653295 (diff)
downloadlectio-ed7717fef53db3b3aa5593fbb2649313e75a0f31.tar.gz
lectio-ed7717fef53db3b3aa5593fbb2649313e75a0f31.zip
cli: --rand/--rand-v (random verse) + --rand-ch (random chapter) from the corpus, using the config default version; v0.16.0
Diffstat (limited to 'internal/bible/booktable.go')
-rw-r--r--internal/bible/booktable.go9
1 files changed, 9 insertions, 0 deletions
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"