Spotted while implementing #7071 (PR #7453) — not fixed there, that PR's fence is the unscheduled area. Filed unassigned.
Measured on origin/main at 5ad0641e0
Two spellings of the same label disagree, and which one a user sees depends on whether an I18nProvider is mounted:
packages/i18n/src/locales/en.ts (and the nine sibling packs) — calendar.allDay: 'All Day'
packages/plugin-calendar/src/CalendarView.tsx:84 — 'calendar.allDay': 'all-day' in DEFAULT_TRANSLATIONS
createSafeTranslation's provider-less arm returns defaults[key] || defaultValue || key, so a standalone embed renders all-day; with a provider mounted the pack wins and the same lane header renders All Day. Six of the seven other entries in that table match their en value exactly — only this one drifted, which is what makes it look like an oversight rather than a deliberate choice.
The dead ternary this leaves behind
CalendarView.tsx:1271:
{t('calendar.allDay') === 'calendar.allDay' ? 'all-day' : t('calendar.allDay')}
The condition can never be true. t here is the createSafeTranslation factory's function, whose provider-less arm falls back to defaults[key] before it would ever return the bare key, and defaults carries calendar.allDay. So the guard is structurally unreachable — a third spelling of the same string, kept alive by nothing.
Why no gate sees it
This is the objectui#3810 class (an inline default contradicting the value the pack serves), but through the one channel scripts/check-i18n-call-site-keys.mjs classifies out of the value comparison. Its own summary on this tree says so:
2768 pack-backed ... 1114 module-local table ...
Inline defaults: 996 literal (993 match their en value, 3 not comparable)
The 996 compared inline defaults are t(key, { defaultValue }) call sites. A createSafeTranslation(DEFAULT_TRANSLATIONS, …) table entry is the same promise — "this is what the pack says" — written one indirection away, and it is counted under "module-local table" and never compared. There are 26 such factories in the repo per that gate's own header, so this is a class with one measured instance, not a one-off.
Not judged here
Which spelling is correct is a copy question, not a mechanical one — en says All Day, the local table says all-day, and the nine translations follow en. Both a fix (align the table to the pack, delete the dead ternary) and a gate extension (value-compare factory defaults tables against en, the way inline defaultValue already is) are plausible, and the second is the one that closes the class. Left to triage.
Spotted while implementing #7071 (PR #7453) — not fixed there, that PR's fence is the unscheduled area. Filed unassigned.
Measured on
origin/mainat5ad0641e0Two spellings of the same label disagree, and which one a user sees depends on whether an
I18nProvideris mounted:packages/i18n/src/locales/en.ts(and the nine sibling packs) —calendar.allDay: 'All Day'packages/plugin-calendar/src/CalendarView.tsx:84—'calendar.allDay': 'all-day'inDEFAULT_TRANSLATIONScreateSafeTranslation's provider-less arm returnsdefaults[key] || defaultValue || key, so a standalone embed renders all-day; with a provider mounted the pack wins and the same lane header renders All Day. Six of the seven other entries in that table match theirenvalue exactly — only this one drifted, which is what makes it look like an oversight rather than a deliberate choice.The dead ternary this leaves behind
CalendarView.tsx:1271:The condition can never be true.
there is thecreateSafeTranslationfactory's function, whose provider-less arm falls back todefaults[key]before it would ever return the bare key, anddefaultscarriescalendar.allDay. So the guard is structurally unreachable — a third spelling of the same string, kept alive by nothing.Why no gate sees it
This is the objectui#3810 class (an inline default contradicting the value the pack serves), but through the one channel
scripts/check-i18n-call-site-keys.mjsclassifies out of the value comparison. Its own summary on this tree says so:The 996 compared inline defaults are
t(key, { defaultValue })call sites. AcreateSafeTranslation(DEFAULT_TRANSLATIONS, …)table entry is the same promise — "this is what the pack says" — written one indirection away, and it is counted under "module-local table" and never compared. There are 26 such factories in the repo per that gate's own header, so this is a class with one measured instance, not a one-off.Not judged here
Which spelling is correct is a copy question, not a mechanical one —
ensaysAll Day, the local table saysall-day, and the nine translations followen. Both a fix (align the table to the pack, delete the dead ternary) and a gate extension (value-compare factorydefaultstables againsten, the way inlinedefaultValuealready is) are plausible, and the second is the one that closes the class. Left to triage.