aboutsummaryrefslogtreecommitdiff
path: root/internal/bible/booktable.go
diff options
context:
space:
mode:
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"