fix(cms): translate the post-calendar scheduling toasts - #6440
Merged
Conversation
The new schedule/reschedule flow added in #6421 (post calendar) hardcoded its four toast strings ("Created scheduled post", "Could not create", "Only scheduled posts can be moved.", "Could not reschedule") instead of going through t(), unlike every other string in this same PR's UI (post-editor.tsx, post-calendar.tsx). Per this repo's i18n rule, any user-facing string in apps/web/src must go through t(). Adds sandbox.postCalendar.{couldNotCreate,couldNotReschedule, createdScheduledPost,onlyScheduledCanMove} to en/pt-br and wires them in content-browser.tsx's handleCreateScheduledPost/handleReschedulePost.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #6421 (post calendar / blog scheduling): the new schedule/reschedule flow's four toast strings ("Created scheduled post", "Could not create", "Only scheduled posts can be moved.", "Could not reschedule") were hardcoded in
content-browser.tsxinstead of going throught(), unlike every other user-facing string that same PR added inpost-editor.tsx/post-calendar.tsx. Per this repo's i18n rule, any string a user reads inapps/web/srcmust go throught()so pt-br users don't see raw English mid-flow.Adds
sandbox.postCalendar.{couldNotCreate,couldNotReschedule,createdScheduledPost,onlyScheduledCanMove}to bothen/sandbox.tsandpt-br/sandbox.ts, and wires them intohandleCreateScheduledPost/handleReschedulePost.To confirm: open a site with blog scheduling support, switch to pt-br in preferences, create a post from the calendar's "+" button and drag a scheduled post to another day — the toasts now read in pt-br instead of English.
Verified locally:
bun run fmt,bunx tsc --noEmitinapps/web(no new errors),bunx oxlinton the three changed files (0 warnings/errors). Full CI (typecheck across all workspaces, lint, tests) validates the rest.Summary by cubic
Localizes post calendar scheduling toasts to follow
apps/webi18n rules. Previously these four toasts were hardcoded in English; now they use t() so pt-br users see translated messages.sandbox.postCalendar.{couldNotCreate,couldNotReschedule,createdScheduledPost,onlyScheduledCanMove}toen/sandbox.tsandpt-br/sandbox.ts.content-browser.tsx(handleCreateScheduledPost,handleReschedulePost) witht(), preservingerr.messagewhen present and using localized fallbacks otherwise.Written for commit 8c02470. Summary will update on new commits.