fix(flows): localize node-summary and cron descriptions (i18n ×14) - #5289
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 8 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (23)
📝 WalkthroughWalkthroughWorkflow node and schedule summaries now use injected translations and locale-aware formatting. Schedule controls display localized weekday labels. Translation catalogs add node and cron description keys across multiple locales. Tests cover localized labels, fallbacks, and summary variants. ChangesLocalized flow summaries
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant FlowCanvas
participant useT
participant describeNode
participant describeSchedule
participant TranslationCatalog
FlowCanvas->>useT: read translation function and locale
FlowCanvas->>describeNode: pass node data, t, and locale
describeNode->>describeSchedule: pass schedule data, t, and locale
describeNode->>TranslationCatalog: resolve node-summary keys
describeNode-->>FlowCanvas: return localized summary
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
|
Review follow-up: clean, no changes applied. Independently verified — 204/204 tests, One real finding, recommended as a follow-up rather than a blocker: the two-form singular/plural split is not sufficient for Russian, Polish, or Arabic. Concretely, with the strings as shipped:
n ∈ {2,3,4} are extremely common cron intervals, so this is not an edge case. The abbreviated short forms ( Not this PR's fault, and that's why it's a follow-up: there is no Recommend shipping this PR and filing the pluralization gap separately; it already affects every other counted-plural string in the app, this PR just adds three more instances of a pre-existing limitation. (Cosmetic, optional: |
3a39433 to
f536313
Compare
There was a problem hiding this comment.
graycyrus has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
app/src/lib/flows/cron.test.ts (1)
118-132: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a test for a real non-English locale.
The current tests exercise
weekdayShortLabel/weekdayNarrowLabelonly with'en'and with an intentionally invalid tag ('not-a-real-locale'). No test confirms thatIntl.DateTimeFormatactually produces correctly localized weekday names for a real non-English locale. This is the core new behavior this cohort introduces, so add at least one assertion against a known locale, for example French or German, to confirm real localization output.✅ Suggested additional test
it('falls back to English for an unsupported locale tag rather than throwing', () => { expect(() => weekdayShortLabel(0, 'not-a-real-locale')).not.toThrow(); }); + + it('localizes weekday names for a real non-English locale', () => { + expect(weekdayShortLabel(3, 'fr')).toBe('mer.'); + }); });As per path instructions,
**/*.{ts,tsx,rs}: "Untested code is incomplete; add tests for new or changed behavior."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/lib/flows/cron.test.ts` around lines 118 - 132, Extend the weekdayShortLabel/weekdayNarrowLabel tests with a real non-English locale, such as French or German, and assert a known localized weekday value returned by Intl.DateTimeFormat. Keep the existing English and invalid-locale coverage unchanged.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/src/lib/i18n/es.ts`:
- Around line 4304-4305: Update the Spanish translation values for the memory
recall node summaries to use the verb "Recupera" instead of "Recuerda". Change
the value for the 'flows.nodeSummary.memory.recallScoped' key from "Recuerda de
la memoria ({scope})" to "Recupera de la memoria ({scope})", and update the
'flows.nodeSummary.memory.recall' key from "Recuerda de la memoria" to "Recupera
de la memoria". This ensures the translations properly reflect the retrieval
operation rather than a remembering action.
In `@app/src/lib/i18n/pt.ts`:
- Line 4360: Update the translation value for flows.cron.everyMinuteOnDays to
use a gender-neutral phrase such as “nos dias {days}” instead of “aos {days}”,
preserving correct wording for mixed weekday abbreviations.
- Around line 4293-4294: Update the Portuguese translations for
flows.nodeSummary.memory.recall and flows.nodeSummary.memory.recallScoped from
“Recorda da memória” to “Recupera da memória”, preserving the existing ({scope})
placeholder in the scoped variant.
---
Nitpick comments:
In `@app/src/lib/flows/cron.test.ts`:
- Around line 118-132: Extend the weekdayShortLabel/weekdayNarrowLabel tests
with a real non-English locale, such as French or German, and assert a known
localized weekday value returned by Intl.DateTimeFormat. Keep the existing
English and invalid-locale coverage unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 86aac8d3-5a6f-4267-988d-e5ff2c782a25
📒 Files selected for processing (23)
app/src/components/flows/canvas/FlowNodeComponent.tsxapp/src/components/flows/canvas/nodeConfig/NodeConfigDrawer.tsxapp/src/components/flows/canvas/nodeConfig/ScheduleField.tsxapp/src/components/flows/canvas/nodeConfig/nodeConfigForms.tsxapp/src/lib/flows/cron.test.tsapp/src/lib/flows/cron.tsapp/src/lib/flows/nodeSummary.test.tsapp/src/lib/flows/nodeSummary.tsapp/src/lib/i18n/ar.tsapp/src/lib/i18n/bn.tsapp/src/lib/i18n/de.tsapp/src/lib/i18n/en.tsapp/src/lib/i18n/es.tsapp/src/lib/i18n/fr.tsapp/src/lib/i18n/hi.tsapp/src/lib/i18n/id.tsapp/src/lib/i18n/it.tsapp/src/lib/i18n/ko.tsapp/src/lib/i18n/pl.tsapp/src/lib/i18n/pt.tsapp/src/lib/i18n/ru.tsapp/src/lib/i18n/zh-CN.tsscripts/i18n-find-english.ts
f536313 to
163c0fd
Compare
There was a problem hiding this comment.
graycyrus has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
describeNode/describeCron/describeEveryMs/describeSchedule returned hardcoded English literals rendered on every canvas node card and in the schedule field, violating the project's useT() rule. Thread `t` (and `locale`, for weekday names) through these pure modules mirroring the existing runStepSummary.ts pattern, add flows.nodeSummary.*/ flows.cron.* keys to en.ts plus real translations across all 14 locales, and derive weekday names from Intl.DateTimeFormat against the active locale instead of hand-translated WEEKDAY_SHORT/WEEKDAY_INITIAL arrays. Allowlist two pure-placeholder strings (HTTP method+URL, quoted prompt+model) in the i18n-find-english leftover-English checker, same as existing entries like channels.activeRouteValue.
163c0fd to
520e50d
Compare
There was a problem hiding this comment.
graycyrus has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Summary
useT().dedup) and every schedule shape.Intl.DateTimeFormat, so weekday names are correct per locale with no translation surface.en.tsplus real translations in all 13 other locales.Problem
Two pure modules returned English string literals that render directly in the UI:
app/src/lib/flows/nodeSummary.ts—describeNodereturned'Runs on demand','Branches to true / false','Merges parallel branches','Recalls memory',`Sets ${n} field${n > 1 ? 's' : ''} on each item`… shown on every canvas node card viaFlowNodeComponent.tsx.app/src/lib/flows/cron.ts—describeCron/describeEveryMs/describeSchedulereturned'Every day at …','weekdays','weekends','No schedule set',`Custom schedule (${expr})`,'Once at …', plus EnglishWEEKDAY_SHORT/WEEKDAY_INITIALarrays — shown inScheduleField.tsx's live summary and weekday toggles, and in trigger node summaries.So a non-English user saw English on every node card and every schedule field. This is drift rather than policy: the sibling
runStepSummary.tsalready takestas a parameter precisely to stay localized.Solution
t(andlocale, for weekday names) as parameters through the pure functions, mirroringrunStepSummary.ts, rather than importing a React hook into them — keeps the modules pure and unit-testable.Intl.DateTimeFormatagainst a fixed Sunday reference date, so they are correct per locale and need no translated arrays.'{method} {url}', the quoted-prompt/model line) are allowlisted inscripts/i18n-find-english.ts, matching the existingchannels.activeRouteValueprecedent.Submission Checklist
src/lib/flows,src/components/flows,src/lib/i18nN/A: localization of existing UI strings, no feature rows added/removed/renamed## Related—N/A: no matrix feature rows affectedN/A: string-rendering change only; the canvas smoke path is unchangedCloses #NNN—N/A: found by code review, no tracking issue filed yetImpact
app/src). No Rust, no Tauri.en.pnpm i18n:checkreports 0 missing / 0 extra across all 13 locales; the coverage test's no-em-dash assertion passes;pnpm i18n:english:checkmeasured 0 on this branch and 0 on the stashed base — no regression.describeNode/describeCron/describeSchedulesignatures changed. All in-repo call sites are updated; these are internal helpers with no external consumers.Related
N/A*/90→*/59) on the next edit — fixed in the stacked residual-minors PR.cron.ts.AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
fix/flows-i18n-node-cron-summaries3a39433dfValidation Run
pnpm --filter openhuman-app format:check— prettier clean on touched files (one auto-fix applied toScheduleField.tsx)pnpm typecheck— clean, exit 0vitest run src/lib/flows src/components/flows src/lib/i18n→ 436 passed across 34 files; i18n coverage suite 67/67app/src-tauriuntouchedValidation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
en) output is unchanged, including the wording of every summary and schedule description; thedescribeSchedulefallback chain is intact.nodeSummary/cronunit tests are preserved with atstub, so the same behavioural assertions still hold.Duplicate / Superseded PR Handling
Summary by CodeRabbit
New Features
Bug Fixes
Tests