-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Translation: desktop-client/src/components/common/search.tsx #3659
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
WalkthroughThe pull request introduces a modification to the Possibly related PRs
Suggested labels
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
packages/desktop-client/src/components/common/Search.tsx (2)
Line range hint
20-20
: Consider translating the placeholder textWhile the "Clear search term" string is now translated, the
placeholder
prop is still passed as a static string. For consistency and complete internationalization, consider translating the placeholder text as well.You could modify the component to accept a translation key for the placeholder and apply the translation function like this:
type SearchProps = { inputRef?: Ref<HTMLInputElement>; value: string; onChange: (value: string) => void; - placeholder: string; + placeholderKey: string; isInModal?: boolean; width?: number; }; export function Search({ inputRef, value, onChange, - placeholder, + placeholderKey, isInModal = false, width = 250, }: SearchProps) { const { t } = useTranslation(); // ... - placeholder={placeholder} + placeholder={t(placeholderKey)} // ... }This change would ensure that the placeholder text is also internationalized.
Also applies to: 33-33
Line range hint
1-93
: Consider a more comprehensive approach to internationalizationWhile the current changes successfully implement translation for the "Clear search term" string, there are opportunities for a more thorough internationalization of the component:
- As mentioned earlier, translate the placeholder text.
- Review the component for any other user-facing strings that might need translation.
- Update the component's props and types to reflect the internationalization changes, such as accepting translation keys instead of direct strings.
- Consider extracting all translatable strings into a separate translation file or constant object for easier management and consistency.
These suggestions would result in a more robust and maintainable internationalized component. Would you like assistance in implementing these improvements?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
upcoming-release-notes/3659.md
is excluded by!**/*.md
📒 Files selected for processing (1)
- packages/desktop-client/src/components/common/Search.tsx (3 hunks)
🧰 Additional context used
🔇 Additional comments (3)
packages/desktop-client/src/components/common/Search.tsx (3)
2-2
: LGTM: Import of useTranslation hookThe import of the
useTranslation
hook from 'react-i18next' is correctly placed and aligns with the PR objective of implementing translation support for this component.
28-28
: LGTM: Usage of useTranslation hook and translation functionThe
useTranslation
hook is correctly used to obtain the translation function, and it's properly applied to the "Clear search term" string. This implementation supports the internationalization of the component as intended.Also applies to: 60-60
Line range hint
1-93
: Summary of review and next stepsThe changes successfully introduce basic translation support for the Search component, aligning with the PR objectives. The implementation is correct but could be more comprehensive.
Next steps to consider:
- Translate the placeholder text.
- Review and translate any other user-facing strings in the component.
- Update component props and types to better support internationalization.
- Extract translatable strings for easier management.
These improvements would result in a fully internationalized component, enhancing the overall user experience across different languages.
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.
Nice! Thanks.
Translation support for packages/desktop-client/components/common/search