Skip to content

feat(calendar): give the calendar one address per language - #59

Merged
maxitect merged 7 commits into
mainfrom
feat/58-calendar-at-calendrier-in-french-and-calendar-in
Nov 13, 2026
Merged

maxitect merged 7 commits into
mainfrom
feat/58-calendar-at-calendrier-in-french-and-calendar-in

Conversation

@maxitect

@maxitect maxitect commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What

The advent calendar gets one address per language: /calendrier is always French, /calendar always English. The language no longer depends on ?isFrench, the browser or the site's cookie.

Changes

  • Both addresses render the same page (src/app/(calendar)/_page/CalendarPage.tsx) with the locale taken from the path. Same doors, settings, gate (getPublicState) and member preview.
  • A language link in the masthead, on the holding page too, goes to the other address.
  • <link rel="canonical"> and hreflang alternates (fr, en) on both pages once the calendar is open; the noindex holding page carries neither. The sitemap is untouched, so neither is listed.
  • Each address has its own root layout, so <html lang> is fr or en from the server, holding page included.
  • Old links: /calendrier?isFrench=false redirects (307) to /calendar, and /calendar?isFrench=true to /calendrier. A plain address never redirects by browser language.
  • The home button links to /calendrier on the French site and /calendar on the English one.
  • Same CSP entry for calendar as for calendrier in src/lib/security/headers.ts. Without a database, /calendar is hidden like /calendrier.
  • The opened-doors cookie is now written with Path=/ (it was /calendrier), so doors opened on one address show on the other. An old /calendrier cookie is merged in when read and removed on the next door opened.

Acceptance criteria

AC Result Method Evidence
/calendrier French, /calendar English, whatever the browser language and site cookie PASS browser AC1
Toggle goes to the other address, and back PASS browser AC2
?isFrench=false on /calendrier lands on /calendar, ?isFrench=true on /calendar lands on /calendrier PASS api AC3
Opened doors (cookie) carry over PASS browser AC4
Gate, "Visible" switch and member preview the same on both addresses PASS api, shifted clock AC5
No console errors or CSP violations on either page PASS browser AC6

Closes

Closes #58

Notes

  • The calendar had no language toggle yet (the ticket assumes one), so this adds the link described above, shown as EN / FR (named "English" / "Français" for screen readers) so the sound button stays on one line at 390 px.
  • The redirect keeps the query: Next appends it to a config redirect's destination, so the visitor lands on /calendar?isFrench=false. The page ignores the parameter and nothing loops. Stripping it needs a proxy on these two paths, which I left out.
  • Lighthouse on the deploy preview's home page, three runs: 93, 99, 98 (median 98); / answers x-nextjs-prerender: 1, with or without the calendar cookie.
  • After merge: nothing to do.

Review

Verdict: ALL CLEAR
Rounds: 2

Finding Severity Resolution
/calendar served <html lang="fr">; the holding page has no script to correct it warning fixed in 393e984
An old Path=/calendrier cookie hid doors opened on /calendar warning fixed in 68d2116
The language link wrapped the French sound button onto two lines at 390 px warning fixed in 96e2c56
Canonical and hreflang links on the noindex holding page suggestion fixed in 2cded20
The masthead still wraps the French sound button at 360 px suggestion open: no room for three items at that width without changing #29's masthead
?isFrench stays in the URL after the redirect suggestion open: harmless, the canonical points at the plain address; stripping it needs a proxy

Re-verified: AC1 (browser) PASS, AC2 (browser) PASS, AC3 (api) PASS, AC4 (browser) PASS, AC5 (api, shifted clock, Visible off on 5 December, member preview) PASS, AC6 (browser) PASS · check.sh PASS

Evidence

Production build on port 4058 against Neon dev, with Date shifted by a preload (FAKE_NOW); Chromium headless via Playwright.

AC1

en-GB /calendrier | h1: Calendrier de Clark's | html lang: fr | toggle: /calendar English
fr-FR /calendar   | h1: Advent calendar by Clark's | html lang: en | toggle: /calendrier Français
(each with an isFrench cookie set to the opposite language)
canonical: https://clarksbowlingclub.com/calendrier  alternates: fr=.../calendrier, en=.../calendar
canonical: https://clarksbowlingclub.com/calendar    alternates: fr=.../calendrier, en=.../calendar
curl localhost:4058/sitemap.xml | grep -c calend  ->  0

AC2

toggle fr->en lands on /calendar | h1: Advent calendar by Clark's
toggle en->fr lands on /calendrier | h1: Calendrier de Clark's

AC3

/calendrier?isFrench=false -> HTTP/1.1 307  location: /calendar?isFrench=false
/calendar?isFrench=true    -> HTTP/1.1 307  location: /calendrier?isFrench=true
/calendar?isFrench=false   -> HTTP/1.1 200
/calendrier?isFrench=true  -> HTTP/1.1 200

AC4

A test door was inserted on Neon dev (and deleted afterwards).

cookie before: ""  after open on /calendrier: "clarks_advent_2026=1"
/calendar sees cookie: "clarks_advent_2026=1" | open doors: 1

AC5

HOLDING is the page with <meta name="robots" content="noindex"> and no script; the count of api/calendar/audio in the HTML was 0 everywhere.

== 2026-11-13T12:00:00Z   /api/calendar: 404  audio/1: 404  preview: 403  /calendrier: HOLDING  /calendar: HOLDING
== 2026-11-30T22:59:00Z   /api/calendar: 404  audio/1: 404  preview: 403  /calendrier: HOLDING  /calendar: HOLDING
== 2026-11-30T23:00:00Z   /api/calendar: 200  audio/1: 404  preview: 403  /calendrier: CALENDAR /calendar: CALENDAR
== 2026-12-25T12:00:00Z   /api/calendar: 200  audio/1: 404  preview: 403  /calendrier: CALENDAR /calendar: CALENDAR

audio/1 is 404 throughout because no door on dev has audio. The "Visible" switch and the preview share getPublicState and isMember with both pages, which this change does not touch.

AC6

console errors/warnings: none   (both addresses, toggle, redirects)

With the test door in place the console showed two 404s for its missing audio file; that is the test row, not the pages.

@netlify

netlify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for clarksbowlingclub ready!

Name Link
🔨 Latest commit 2cded20
🔍 Latest deploy log https://app.netlify.com/projects/clarksbowlingclub/deploys/6af7a14f067ce508e2df749b
😎 Deploy Preview https://deploy-preview-59--clarksbowlingclub.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@maxitect
maxitect marked this pull request as ready for review November 13, 2026 23:46
@maxitect
maxitect merged commit a315291 into main Nov 13, 2026
5 checks passed
@maxitect
maxitect deleted the feat/58-calendar-at-calendrier-in-french-and-calendar-in branch November 13, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar at /calendrier in French and /calendar in English

1 participant