fix(i18n): localize ChatGPT OAuth strings in onboarding ApiKeysStep#2975
fix(i18n): localize ChatGPT OAuth strings in onboarding ApiKeysStep#2975obchain wants to merge 1 commit into
Conversation
The ChatGPT sign-in button/connected/hint labels and four OAuth error messages were hard-coded English (module consts + inline setError), so non-English users saw untranslated onboarding text. Route them through useT() with onboarding.apiKeys.* keys, matching the t() pattern the rest of the step already uses.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (16)
📝 WalkthroughWalkthroughThis PR adds internationalization support for the ChatGPT OAuth sign-in flow. Translation keys for OAuth-related messages (connect/connected labels, desktop-only restrictions, redirect URL instructions, and error messages) are defined in the base English translation file and across twelve additional language chunks, then the ApiKeysStep component is updated to reference these i18n keys instead of hardcoded strings. ChangesChatGPT OAuth i18n Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
oxoxDev
left a comment
There was a problem hiding this comment.
LGTM — i18n cleanup for the ChatGPT OAuth onboarding step. Hardcoded label/hint/error constants in ApiKeysStep replaced with t() lookups, keys added to en.ts + chunks. No behavior change. Approving.
Summary
ApiKeysStep.tsx): the connect / connected / callback-hint labels (previously module-level consts) and the foursetErrormessages, all of which bypassed i18n.useT()with newonboarding.apiKeys.*keys, matching thet()pattern the rest of the step already uses (14 existing calls).Problem
app/src/pages/onboarding/steps/ApiKeysStep.tsxrendered the ChatGPT-sign-in button label, the connected badge, the callback hint, and four OAuth error messages from hard-coded English literals:This violates the repo i18n rule (every user-visible string in
app/src/**must go throughuseT()), so a non-English user hits English text throughout the onboarding ChatGPT-connect path.Solution
t('onboarding.apiKeys.openaiOauthConnect' | 'openaiOauthConnected' | 'openaiOauthCallbackHint').setError(...)literals witht('onboarding.apiKeys.oauthDesktopOnly' | 'oauthStartFailed' | 'oauthPasteRedirect' | 'oauthCompleteFailed').OPENAI_OAUTH_CALLBACK_PLACEHOLDER) as-is — it is a non-display technical sentinel, exempt from i18n.en.tsand every locale chunk. English values are unchanged, so the existing test assertions still match.Verification
pnpm typecheck— clean.pnpm exec eslint— 0 errors on the changed file (one pre-existingset-state-in-effectwarning, unrelated to these lines).pnpm i18n:check— parity clean across all locales.ApiKeysStep.test.tsx— 7 passed; the existing OAuth tests already assert each of the seven strings (connected badge, connect click, desktop-only / start-failed / paste-redirect / complete-failed errors), so they exercise every changed line.Submission Checklist
ApiKeysStep.test.tsxOAuth suite.## Related— N/A.docs/RELEASE-MANUAL-SMOKE.md) — N/A: no release-cut surface.Closes #NNNin the## Relatedsection — N/A: i18n rule-violation fix, no tracking issue.Impact
Related
onboarding.apiKeys.*keys (ship as English placeholders).AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
fix/apikeys-step-i18n6a5ed7d9c8993ff43f2a6a950857ddaf9521d713Validation Run
pnpm --filter openhuman-app format:check— Prettier clean on touched files.pnpm typecheck— clean.vitest run ApiKeysStep.test.tsx→ 7 passed.app/src-tauri/changed.Validation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
t(); the URL placeholder remains a literal sentinel.Duplicate / Superseded PR Handling
Summary by CodeRabbit
Release Notes
New Features
Documentation