-
-
Notifications
You must be signed in to change notification settings - Fork 845
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
fix: Translation fix for Left Drawer #2018
fix: Translation fix for Left Drawer #2018
Conversation
WalkthroughThe changes introduce internationalization support across various components by adding translations for multiple languages (French, Hindi, Spanish, and Chinese) in the Changes
Sequence Diagram(s) (Beta)Silently ignored generating this section as the changes are mostly related to localization and minor enhancements. Assessment against linked issues
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Our Pull Request Approval ProcessWe have these basic policies to make the approval process smoother for our volunteer team. Testing Your CodePlease make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:
The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
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 (6)
src/components/CollapsibleDropdown/CollapsibleDropdown.tsx (2)
Line range hint
24-24
: AddsetShowDropdown
to the dependency array ofuseEffect
to adhere to best practices.- }, [location.pathname]); + }, [location.pathname, setShowDropdown]);
Line range hint
57-89
: Consider using optional chaining for safer access to properties.- subTargets.map(({ name, icon: stringIcon, url }, index) => { + subTargets?.map(({ name, icon: stringIcon, url }, index) => {src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (4)
Line range hint
93-93
: Replace==
with===
for strict equality checks.- name == 'Membership Requests' ? 'Requests' : name + name === 'Membership Requests' ? 'Requests' : nameAlso applies to: 146-146
Line range hint
109-109
: Simplify alt text and avoid redundant words like "picture".- alt={`profile picture`} + alt={`profile`}
Line range hint
47-47
: Addtargets
to the dependency array ofuseEffect
to adhere to best practices.- }, [data]); + }, [data, targets]);
Line range hint
88-91
: Add explicittype="button"
to button elements to adhere to best practices.- <button + <button type="button"Also applies to: 95-98, 106-106
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (7)
- public/locales/en/common.json (1 hunks)
- public/locales/fr/common.json (1 hunks)
- public/locales/hi/common.json (1 hunks)
- public/locales/sp/common.json (1 hunks)
- public/locales/zh/common.json (1 hunks)
- src/components/CollapsibleDropdown/CollapsibleDropdown.tsx (4 hunks)
- src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
- public/locales/fr/common.json
Additional context used
Biome
src/components/CollapsibleDropdown/CollapsibleDropdown.tsx
[error] 57-89: Change to an optional chain.
[error] 1-1: The default import is only used as a type.
[error] 24-24: This hook does not specify all of its dependencies: setShowDropdown
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx
[error] 93-93: Use === instead of ==.
== is only allowed when comparing againstnull
[error] 109-109: Avoid the words "image", "picture", or "photo" in img element alt text.
[error] 109-109: Do not use template literals if interpolation and special-character handling are not needed.
[error] 146-146: Use === instead of ==.
== is only allowed when comparing againstnull
[error] 47-47: This hook does not specify all of its dependencies: targets
[error] 88-91: Provide an explicit type prop for the button element.
[error] 95-98: Provide an explicit type prop for the button element.
[error] 106-106: Provide an explicit type prop for the button element.
Additional comments not posted (7)
public/locales/zh/common.json (1)
51-64
: Translations for new terms added correctly.public/locales/en/common.json (1)
51-64
: Translations for new terms added correctly.public/locales/hi/common.json (1)
51-64
: Translations for new terms added correctly.public/locales/sp/common.json (1)
51-64
: Translations for new terms added correctly.src/components/CollapsibleDropdown/CollapsibleDropdown.tsx (2)
7-7
: Import ofuseTranslation
added correctly.
20-20
: Ensure proper translation function usage.Also applies to: 47-47, 77-77
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (1)
154-154
: Ensure proper translation function usage.
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- src/components/CollapsibleDropdown/CollapsibleDropdown.test.tsx (3 hunks)
Additional comments not posted (2)
src/components/CollapsibleDropdown/CollapsibleDropdown.test.tsx (2)
7-10
: Imports for Redux and i18next are correctly added to support internationalization in tests.
48-52
: The component is correctly wrapped withProvider
andI18nextProvider
to ensure proper state and internationalization context during testing.Also applies to: 63-67
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2018 +/- ##
========================================
Coverage 98.39% 98.39%
========================================
Files 210 210
Lines 5802 5804 +2
Branches 1711 1712 +1
========================================
+ Hits 5709 5711 +2
Misses 87 87
Partials 6 6 ☔ View full report in Codecov by Sentry. |
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.
Good to have translations to the left drawer too. Can you also add translation for file upload button as outlined in issue?
After exploring the web, I found that the "Choose File" and "No file chosen" text cannot be translated by our application. These strings are defined and translated by the browser itself, not by our application. This means their localization is managed by the browser, and we do not have control over their translation. |
What kind of change does this PR introduce?
Translation fix
Issue Number:
Fixes #1925
Did you add tests for your changes?
NA
Snapshots/Videos:
If relevant, did you update the documentation?
NA
Summary
Fixed translation for left drawer by adding common translations and using the tCommon for rendering left drawer
Does this PR introduce a breaking change?
NA
Other information
NA
Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
CollapsibleDropdown
andLeftDrawerOrg
components to support internationalization.Tests
CollapsibleDropdown
tests to include internationalization support.