aboutsummaryrefslogtreecommitdiff
path: root/internal/cli/liturgy.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli/liturgy.go')
-rw-r--r--internal/cli/liturgy.go20
1 files changed, 6 insertions, 14 deletions
diff --git a/internal/cli/liturgy.go b/internal/cli/liturgy.go
index 07a87bc..9d7f3b6 100644
--- a/internal/cli/liturgy.go
+++ b/internal/cli/liturgy.go
@@ -11,6 +11,7 @@ import (
"github.com/lukaszkasprzak/lectio/internal/calendar"
"github.com/lukaszkasprzak/lectio/internal/config"
"github.com/lukaszkasprzak/lectio/internal/i18n"
+ "github.com/lukaszkasprzak/lectio/internal/naming"
"github.com/lukaszkasprzak/lectio/internal/render"
)
@@ -149,23 +150,14 @@ func printLiturgicalDay(out io.Writer, cfg config.Config, tbl *bible.BookTable,
}
}
-// celebrationName is the celebration's name in the UI language (falling back to
-// English, then a humanized slug for temporal days that carry no proper name).
+// celebrationName is the celebration's name in the UI language, resolved by
+// naming.CelebrationName (name.<lang> -> English -> Latin -> humanized slug).
+// A bare, unnamed feria renders as "(feria)".
func celebrationName(cfg config.Config, c calendar.Celebration) string {
- lang := "en"
- if cfg.UILanguage == "pl" {
- lang = "pl"
- }
- if n := c.Name[lang]; n != "" {
- return n
- }
- if n := c.Name["en"]; n != "" {
+ if n := naming.CelebrationName(cfg.UILanguage, c); n != "" {
return n
}
- if c.Slug == "" {
- return "(feria)"
- }
- return calendar.HumanizeSlug(c.Slug)
+ return "(feria)"
}
func rankLabel(r calendar.Rank) string {