diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-24 15:25:50 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-24 15:25:50 +0200 |
| commit | ed7717fef53db3b3aa5593fbb2649313e75a0f31 (patch) | |
| tree | 023601285808a4704f5646bf6e4777beea6dd93a /internal/bible/booktable.go | |
| parent | 1e4939874a14d8abb13e82b2273bfc5f9d653295 (diff) | |
| download | lectio-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.go | 9 |
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" |
