Skip to content

fix(calendar): correct mistyped toastui template keys so translations apply - #231

Open
lmzr wants to merge 3 commits into
gristlabs:masterfrom
lmzr:fix-i18n-template-keys
Open

fix(calendar): correct mistyped toastui template keys so translations apply#231
lmzr wants to merge 3 commits into
gristlabs:masterfrom
lmzr:fix-i18n-template-keys

Conversation

@lmzr

@lmzr lmzr commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Two template callbacks in the calendar widget were registered under misspelled keys, so toastui-calendar never invoked them and rendered its hardcoded English labels:

  • poupSavepopupSave (event popup "Save" button)
  • allDayTitlealldayTitle (week/day all-day row label)

The i18next keys (t('Save'), t('All Day')) already existed in every populated translation file; only the template names were wrong. Bug present since #65.

Follow-up (2nd commit): once alldayTitle fires, it returns a string, which toastui wraps in a bare .template-alldayTitle element (it only merges the class onto its own default vnode). That dropped the built-in .left-content cell styling, leaving the label oversized and top-aligned. A CSS rule re-applies display:table-cell; font-size:11px; text-align:right; vertical-align:middle to the wrapper, restoring the default look — now translated.

lmzr and others added 2 commits July 2, 2026 10:45
Two template callbacks were registered under misspelled keys, so
toastui-calendar never invoked them and rendered its hardcoded English
labels instead:

- poupSave    -> popupSave   (event popup "Save" button)
- allDayTitle -> alldayTitle (week/day all-day row label)

The i18next keys t('Save') and t('All Day') already existed in every
populated translation file; only the template names were wrong, so the
fix is code-side only. Bug present in master since gristlabs#65.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
toastui-calendar merges the `template-alldayTitle` class onto its own
default vnode, but wraps a *string*-returning template in a fresh
`.template-alldayTitle` element instead — so our translated label lost
the built-in `.left-content` table-cell styling and rendered oversized
and top-aligned in the all-day panel.

Re-apply that styling (table-cell, 11px, right-aligned, middle) to the
wrapper class so the localized label matches the library default:
vertically centered, small font. Verified live via CDP (offset 0).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@netlify

netlify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Deploy Preview for boisterous-sunburst-a5c941 ready!

Name Link
🔨 Latest commit 18e29f7
🔍 Latest deploy log https://app.netlify.com/projects/boisterous-sunburst-a5c941/deploys/6a57aba4f9f5480008dfc1f9
😎 Deploy Preview https://deploy-preview-231--boisterous-sunburst-a5c941.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.

@fflorent fflorent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fflorent fflorent moved this to Needs feedback in French administration Board Jul 13, 2026
@fflorent fflorent moved this from Needs feedback to Needs Internal Feedback in French administration Board Jul 15, 2026
The all-day title cell is pinned to the 72px hour-gutter width but laid out as `display: table`, where that's only a minimum: a nowrap label longer than "All day" (e.g. "Toute la journée") widened it and shifted the whole all-day row ~17px right. Let the label wrap so the cell keeps the gutter width and the day-cells stay aligned in any language. Verified via CDP: fr-FR 17px -> 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

3 participants