-
-
Notifications
You must be signed in to change notification settings - Fork 732
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: fixed text on the events page two buttons and linked it to the common.json file #3488
fix: fixed text on the events page two buttons and linked it to the common.json file #3488
Conversation
…linked it to the common.json file
…linked it to the common.json file
Warning Rate limit exceeded@BalrajDhakad has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 26 minutes and 53 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThe pull request introduces localization improvements for two button components: Changes
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-3488--asyncapi-website.netlify.app/ |
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: 2
🔭 Outside diff range comments (1)
components/buttons/GoogleCalendarButton.tsx (1)
Based on the gathered information, I can now provide the final response:
Direct JSON imports should be replaced with proper translation hooks
The codebase shows inconsistent localization implementation:
- Both
GoogleCalendarButton
andICSFileButton
components directly import and use the JSON file, which bypasses the i18n system- Other components correctly use the
useTranslation
hook witht()
function for translations- The translation keys exist in the common.json file but are being accessed incorrectly
Required changes:
- Remove the direct import of
common.json
in both button components- Replace
details.googleCalendarBtn
witht('googleCalendarBtn')
- Replace
details.icsFileBtn
witht('icsFileBtn')
🔗 Analysis chain
Line range hint
1-42
: Verify localization implementation across the applicationLet's verify that the localization keys are properly defined in the common.json file and that there are no other direct JSON imports in the codebase.
Let me gather more information about the localization implementation to ensure we have a complete picture.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if the translation keys exist in common.json echo "Checking for translation keys in common.json..." cat public/locales/en/common.json | jq '.googleCalendarBtn, .icsFileBtn' # Look for other direct imports of JSON locale files echo "Checking for other direct JSON imports..." rg "from.*locales.*common.json"Length of output: 550
Script:
#!/bin/bash # Check for other uses of useTranslation echo "Checking for useTranslation usage patterns..." rg "useTranslation" -A 2 # Check for direct variable usage from JSON files echo "Checking for direct usage of imported JSON variables..." ast-grep --pattern 'details.$_' # Check for other translation patterns echo "Looking for t() function calls..." rg "t\(['\"].*['\"]" --type ts --type tsxLength of output: 10591
🧰 Tools
🪛 eslint
[error] 29-29: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 29-30: Replace
··⏎
with⏎··
(prettier/prettier)
[error] 32-32: Insert
··
(prettier/prettier)
[error] 32-32: 'googleCalenderBtnText' is never reassigned. Use 'const' instead.
(prefer-const)
🧹 Nitpick comments (1)
components/buttons/ICSFileButton.tsx (1)
30-33
: Clean up variable declaration and commentThe variable declaration and comment can be removed as they're not necessary when using the translation key directly. If you need to keep the variable, it should use
const
since it's never reassigned.-// created a variable with name 'icsFileBtnText' to take the value from 'common.json' file to add text on the button - -let icsFileBtnText = details.icsFileBtn;🧰 Tools
🪛 eslint
[error] 30-30: Insert
··
(prettier/prettier)
[error] 32-32: Insert
··
(prettier/prettier)
[error] 32-32: 'icsFileBtnText' is never reassigned. Use 'const' instead.
(prefer-const)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/buttons/GoogleCalendarButton.tsx
(2 hunks)components/buttons/ICSFileButton.tsx
(2 hunks)
🧰 Additional context used
🪛 eslint
components/buttons/ICSFileButton.tsx
[error] 1-9: Run autofix to sort these imports!
(simple-import-sort/imports)
[error] 30-30: Insert ··
(prettier/prettier)
[error] 32-32: Insert ··
(prettier/prettier)
[error] 32-32: 'icsFileBtnText' is never reassigned. Use 'const' instead.
(prefer-const)
components/buttons/GoogleCalendarButton.tsx
[error] 1-9: Run autofix to sort these imports!
(simple-import-sort/imports)
[error] 29-29: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 29-30: Replace ··⏎
with ⏎··
(prettier/prettier)
[error] 32-32: Insert ··
(prettier/prettier)
[error] 32-32: 'googleCalenderBtnText' is never reassigned. Use 'const' instead.
(prefer-const)
🔇 Additional comments (1)
components/buttons/GoogleCalendarButton.tsx (1)
9-9
: Avoid direct import of JSON locale files
Same issue as in ICSFileButton.tsx - direct imports of JSON locale files should be avoided.
🧰 Tools
🪛 eslint
[error] 1-9: Run autofix to sort these imports!
(simple-import-sort/imports)
That's not how this issue has to be resolved. A new page with translations API has to be created. Closing this PR. |
Can you please elaborate a bit more on how this issue should be resolved. |
-Screenshots
With Error
Fixed
-Description
-Issue resolved
#3465
Summary by CodeRabbit