diff options
Diffstat (limited to 'internal/calfeed')
| -rw-r--r-- | internal/calfeed/build.go | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/internal/calfeed/build.go b/internal/calfeed/build.go index 216daff..8b4f7f0 100644 --- a/internal/calfeed/build.go +++ b/internal/calfeed/build.go @@ -4,6 +4,7 @@ import ( "time" "github.com/lukaszkasprzak/lectio/internal/calendar" + "github.com/lukaszkasprzak/lectio/internal/naming" ) // Build computes the day list from..to inclusive (calendar.Compute per date) @@ -49,19 +50,12 @@ func celView(uiLang string, c calendar.Celebration) CelView { } } -// celebrationName resolves c's name in uiLang, falling back to English, then -// a humanized slug (with the "ef-" prefix stripped and dashes turned to -// spaces), then "(feria)" for an unnamed temporal day. Mirrors -// cli.celebrationName. +// celebrationName resolves c's name in uiLang via naming.CelebrationName +// (name.<lang> -> English -> Latin -> humanized slug), then "(feria)" for an +// unnamed temporal day. func celebrationName(uiLang string, c calendar.Celebration) string { - if n := c.Name[uiLang]; n != "" { + if n := naming.CelebrationName(uiLang, c); n != "" { return n } - if n := c.Name["en"]; n != "" { - return n - } - if c.Slug == "" { - return "(feria)" - } - return calendar.HumanizeSlug(c.Slug) + return "(feria)" } |
