Add bilingual day-label headers with Latin weekday/season/ordinal vocabulary
Builds every day label as a {en, la} pair (weekdays, ranks, season/ordinal
phrasing authored in Latin; proper names without an authored Latin form
fall back to their English string) and merges the date+day-label into one
header in the day-nav bar.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+18
-3
@@ -1,13 +1,28 @@
|
||||
import { getState, shiftDate, goToToday } from '../app-state';
|
||||
import { formatDateLong } from './format';
|
||||
import { resolveDay } from '../calendar';
|
||||
import { getDayLabel } from '../calendar/day-label';
|
||||
import { formatDateLong, renderBilingual } from './format';
|
||||
|
||||
/** Renders navigation plus the merged "when" header: the civil date/
|
||||
* weekday and the liturgical day-being-celebrated, together in one place
|
||||
* — previously the date lived here while the day-being-celebrated text
|
||||
* was repeated separately inside every hour's own view. The day-being-
|
||||
* celebrated text is hour-independent (the same LiturgicalDay for every
|
||||
* hour on a given date), so it's resolved directly here via `resolveDay`
|
||||
* rather than through any particular hour's `resolveOrdo`. */
|
||||
export function renderDayNav(container: HTMLElement): void {
|
||||
const { date } = getState();
|
||||
const { date, languages } = getState();
|
||||
const day = resolveDay(date);
|
||||
const dateLabel = formatDateLong(date);
|
||||
const dayLabel = getDayLabel(day);
|
||||
container.innerHTML = `
|
||||
<nav class="day-nav" aria-label="Day navigation">
|
||||
<button type="button" class="day-nav-btn" data-action="prev" aria-label="Previous day">←</button>
|
||||
<button type="button" class="day-nav-btn day-nav-today" data-action="today">Today</button>
|
||||
<span class="day-nav-date">${formatDateLong(date)}</span>
|
||||
<div class="day-nav-header">
|
||||
${renderBilingual(dateLabel, languages, 'day-nav-date')}
|
||||
${renderBilingual(dayLabel, languages, 'day-nav-label')}
|
||||
</div>
|
||||
<button type="button" class="day-nav-btn" data-action="next" aria-label="Next day">→</button>
|
||||
</nav>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user