From efeadd49b9d78e29778647835bd2a454ddce73a5 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 28 Jul 2026 11:00:19 +0200 Subject: feat: humanize temporal-day display names (OF + EF) Temporal days with no proper name showed a slug-derived string ('triduum fri', 'ordinary 11 tue', 'advent-dec-17'). Add calendar.HumanizeSlug, used by both celebrationName fallbacks (cli + calfeed), turning slugs into proper liturgical names: Good Friday, Ash Wednesday, 'Tuesday of the 11th Week in Ordinary Time', '11th Sunday in Ordinary Time', 'December 17', 'The Most Holy Trinity', and the EF forms ('4th Week after Pentecost', 'Passion Week', 'Ember Wednesday of September'). Adds TestHumanizeSlug. --- internal/calendar/names_test.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 internal/calendar/names_test.go (limited to 'internal/calendar/names_test.go') diff --git a/internal/calendar/names_test.go b/internal/calendar/names_test.go new file mode 100644 index 0000000..217f481 --- /dev/null +++ b/internal/calendar/names_test.go @@ -0,0 +1,27 @@ +package calendar + +import "testing" + +func TestHumanizeSlug(t *testing.T) { + cases := map[string]string{ + "ordinary-sunday-11": "11th Sunday in Ordinary Time", + "ordinary-11-tue": "Tuesday of the 11th Week in Ordinary Time", + "advent-2-mon": "Monday of the 2nd Week of Advent", + "advent-dec-17": "December 17", + "lent-after-ashes-wed": "Ash Wednesday", + "lent-after-ashes-thu": "Thursday after Ash Wednesday", + "triduum-fri": "Good Friday", + "easter-octave-mon": "Monday in the Octave of Easter", + "christmas-jan-2": "January 2", + "christmas-after-epiphany-mon": "Monday after the Epiphany", + "trinity-sunday": "The Most Holy Trinity", + "ef-time-after-pentecost-4-tue": "Tuesday of the 4th Week after Pentecost", + "ef-passiontide-0-thursday": "Thursday of Passion Week", + "ef-september-ember-wed": "Ember Wednesday of September", + } + for slug, want := range cases { + if got := HumanizeSlug(slug); got != want { + t.Errorf("HumanizeSlug(%q) = %q, want %q", slug, got, want) + } + } +} -- cgit v1.3