-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(i18n): remove hardcoded strings from TaskCreationWizard #798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix(i18n): remove hardcoded strings from TaskCreationWizard #798
Conversation
Replace all hardcoded user-facing strings with i18n translation keys. Changes: - Added 11 new translation keys to tasks.creation section - Replaced hardcoded strings in TaskCreationWizard component - Updated both English and French translations Strings replaced: - Dialog title and description - Field labels (Description, Task Title) - Placeholders and help text - Draft restoration messages - Classification section label Contributes to AndyMik90#733 - Standardize Frontend i18n Implementation Signed-off-by: gagarinyury <[email protected]>
📝 WalkthroughWalkthroughThe TaskCreationWizard component is being refactored to retrieve all user-facing text strings from i18n translations instead of hard-coded English literals. Corresponding translation keys are added to both English and French locale files for dialog titles, button labels, placeholders, help text, and field labels. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (4)apps/frontend/src/**/*.{ts,tsx,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
apps/frontend/src/**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
apps/frontend/**/*.{ts,tsx}⚙️ CodeRabbit configuration file
Files:
apps/frontend/src/shared/i18n/locales/**/*.json📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (6)📓 Common learnings📚 Learning: 2025-12-30T16:38:36.314ZApplied to files:
📚 Learning: 2025-12-30T16:38:36.314ZApplied to files:
📚 Learning: 2025-12-30T16:38:36.314ZApplied to files:
📚 Learning: 2025-12-30T16:38:36.314ZApplied to files:
📚 Learning: 2026-01-04T23:59:45.209ZApplied to files:
🧬 Code graph analysis (1)apps/frontend/src/renderer/components/TaskCreationWizard.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (3)
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 |
Summary of ChangesHello @gagarinyury, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the internationalization capabilities of the application by localizing the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request is a great step towards fully internationalizing the TaskCreationWizard component. The changes correctly replace several hardcoded strings with translation keys.
However, the component still contains a number of user-facing hardcoded strings. To fully achieve the goal of this PR, these should also be moved to the i18n resource files. Since I cannot comment on these lines directly as they are not part of the diff, I'm listing them here for your convenience:
Image added successfully!(L914)- Labels in advanced options like
Category(L945),Priority(L968), etc. - Placeholders like
Select category(L953),Select priority(L976), etc. - Help text for advanced options:
These labels help organize...(L1036) - Review requirement label and description (L1055, L1058)
- Git options labels and help texts (L1077, L1096, L1118)
- The
Use project default...string in the branch selector (L1104, L1108) - Button texts:
Hide Files/Browse Files(L1167),Cancel(L1173),Creating...(L1179), andCreate Task(L1182). - Various error messages set via
setError(), e.g.,Maximum of X images allowed.
Addressing these will make the component fully localizable as intended.
| <div className="space-y-2"> | ||
| <Label htmlFor="description" className="text-sm font-medium text-foreground"> | ||
| Description <span className="text-destructive">*</span> | ||
| {t('creation.descriptionLabel')} <span className="text-destructive">*</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the label text is now translated, the asterisk * for indicating a required field remains hardcoded. This can be problematic for localization, as different languages have different conventions for marking required fields (e.g., placing the * before the label).
For better internationalization, I recommend using the Trans component from react-i18next. This allows the entire label, including the asterisk and its styling, to be translatable.
You'll need to import Trans from react-i18next. Then, you can update the Label as suggested. In your JSON translation file, you would create a new key like this:
"descriptionLabelRequired": "Description <1>*</1>"
| {t('creation.descriptionLabel')} <span className="text-destructive">*</span> | |
| <Trans i18nKey="creation.descriptionLabelRequired">Description <span className="text-destructive">*</span></Trans> |
AndyMik90
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 Auto Claude PR Review
Merge Verdict: 🟠 NEEDS REVISION
🟠 Needs revision - 1 issue(s) require attention.
1 issue(s) must be addressed (0 required, 1 recommended), 1 suggestions
Risk Assessment
| Factor | Level | Notes |
|---|---|---|
| Complexity | Low | Based on lines changed |
| Security Impact | None | Based on security findings |
| Scope Coherence | Good | Based on structural review |
Findings Summary
- Medium: 1 issue(s)
- Low: 1 issue(s)
Generated by Auto Claude PR Review
Findings (2 selected of 2 total)
🟡 [aae83ab0a0a8] [MEDIUM] PR claims completeness but leaves ~20+ hardcoded strings
📁 apps/frontend/src/renderer/components/TaskCreationWizard.tsx:0
The PR description states it 'removes all hardcoded user-facing strings from the TaskCreationWizard component', but multiple reviewers found approximately 20+ hardcoded strings still present. The 11 strings that WERE converted are correct and follow existing patterns, but the remaining untranslated strings include: footer buttons ('Cancel', 'Create Task', 'Creating...', 'Browse Files', 'Hide Files'), classification section labels ('Category', 'Priority', 'Complexity', 'Impact' and their placeholders), review requirement section text, Git options section labels, image success message, and error messages. Either complete the i18n conversion or update the PR description to accurately reflect the partial scope.
Suggested fix:
Option 1: Complete the i18n conversion by adding translation keys for all remaining hardcoded strings (~20+ strings). Option 2: Update the PR description to accurately state 'Converts 11 specific strings to i18n' rather than claiming to remove 'all' hardcoded strings.
🔵 [59fdd1180aa6] [LOW] Gemini Code Assist asterisk concern is a false positive
📁 apps/frontend/src/renderer/components/TaskCreationWizard.tsx:762
Gemini flagged the hardcoded asterisk * for required fields as problematic for i18n. This is a FALSE POSITIVE. The asterisk is a universal symbol for required fields used consistently across 8+ components in this codebase (AddFeatureDialog, TaskEditDialog, ProfileEditDialog, etc.) with the exact same pattern: <span className="text-destructive">*</span>. The asterisk is recognized globally and does not need translation. Proper accessibility is already implemented via aria-required="true" on the input elements.
Suggested fix:
No fix needed. The asterisk is intentionally hardcoded as part of the established UI pattern. Dismiss the Gemini comment.
This review was generated by Auto Claude.
Overview
This PR removes all hardcoded user-facing strings from the TaskCreationWizard component and replaces them with i18n translation keys, enabling proper localization.
Related Issue
Contributes to #733 - Standardize Frontend i18n Implementation
Changes
Translation Keys Added (11 new keys in
tasks.creation):dialogDescription- Main dialog description textdescriptionLabel- "Description" labeldescriptionPlaceholder- Long description field placeholderdescriptionHelp- Help text for drag & droptitleLabel- "Task Title" labeltitleOptional- "(optional)" suffixtitlePlaceholder- Title field placeholdertitleHelp- Auto-generation help textdraftRestored- Draft restoration notificationstartFresh- Start fresh buttonclassificationOptional- Classification section labelFiles Modified:
apps/frontend/src/renderer/components/TaskCreationWizard.tsx- Replaced 11 hardcoded strings witht()callsapps/frontend/src/shared/i18n/locales/en/tasks.json- Added English translationsapps/frontend/src/shared/i18n/locales/fr/tasks.json- Added French translationsBefore/After
Before:
After:
Testing
Impact
Next Steps
This is part of the larger effort in #733. The same pattern can be applied to the remaining 187 components with hardcoded strings.
Translation coverage: English ✅ | French ✅
Component tested: TaskCreationWizard ✅
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.