-
-
Notifications
You must be signed in to change notification settings - Fork 19
Add translations to workspace invitation page #3063
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
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
WalkthroughAll user-facing text in the workspace invitation component was updated to use internationalization. Hardcoded strings were replaced with translation function calls, ensuring UI text dynamically adapts to the selected locale. The import for the translation hook was added, and no logic or control flow was changed. The workspace link URL was updated from Changes
Poem
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
apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsxOops! Something went wrong! :( ESLint: 9.28.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@typescript-eslint/parser' imported from /eslint.config.mjs ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3063 +/- ##
==========================================
- Coverage 0.84% 0.84% -0.01%
==========================================
Files 2469 2469
Lines 301703 301706 +3
Branches 2970 2970
==========================================
Hits 2546 2546
- Misses 297019 297022 +3
Partials 2138 2138 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
🧹 Nitpick comments (1)
apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx (1)
23-38
: Ensure all translation keys exist and consider grouping.You’re now pulling a dozen individual keys via
t('…')
. Make sure each key (invited-to
,decline-invite
,accept-invite
,accept-invite-success-title
, etc.) is defined under theinvite
namespace in your locale files to avoid missing-translation fallbacks at runtime.You could also collapse these into logical objects for clarity:
- const invitedTo = t('invited-to'); - const declineInviteLabel = t('decline-invite'); - const acceptInviteLabel = t('accept-invite'); - const acceptInviteSuccessTitle = t('accept-invite-success-title'); - const acceptInviteSuccessMessage = t('accept-invite-success-msg'); - const acceptInviteErrorTitle = t('accept-invite-error-title'); - const acceptInviteErrorMessage = t('accept-invite-error-msg'); - const declineInviteSuccessTitle = t('decline-invite-success-title'); - const declineInviteSuccessMessage = t('decline-invite-success-msg'); - const declineInviteErrorTitle = t('decline-invite-error-title'); - const declineInviteErrorMessage = t('decline-invite-error-msg'); + const labels = { + invitedTo: t('invited-to'), + decline: t('decline-invite'), + accept: t('accept-invite'), + }; + const notifications = { + accept: { + success: { title: t('accept-invite-success-title'), description: t('accept-invite-success-msg') }, + error: { title: t('accept-invite-error-title'), description: t('accept-invite-error-msg') }, + }, + decline: { + success: { title: t('decline-invite-success-title'), description: t('decline-invite-success-msg') }, + error: { title: t('decline-invite-error-title'), description: t('decline-invite-error-msg') }, + }, + };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx
(2 hunks)
🔇 Additional comments (2)
apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx (2)
7-7
: Import ofuseTranslations
is correct.Adding
useTranslations
here enables hooking into theinvite
namespace for all subsequent calls.
19-19
: Verify translation namespace alignment.You’ve wired up
const t = useTranslations('invite')
. Please confirm that you have a matchinginvite
translation file (e.g.locales/<locale>/invite.json
) so this hook can resolve your keys.
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx
(3 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx
[warning] 7-7: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L7
Added line #L7 was not covered by tests
[warning] 19-19: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L19
Added line #L19 was not covered by tests
[warning] 23-23: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L23
Added line #L23 was not covered by tests
[warning] 25-26: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L25-L26
Added lines #L25 - L26 were not covered by tests
[warning] 28-29: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L28-L29
Added lines #L28 - L29 were not covered by tests
[warning] 31-32: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L31-L32
Added lines #L31 - L32 were not covered by tests
[warning] 34-35: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L34-L35
Added lines #L34 - L35 were not covered by tests
[warning] 37-38: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L37-L38
Added lines #L37 - L38 were not covered by tests
[warning] 90-92: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L90-L92
Added lines #L90 - L92 were not covered by tests
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: build (22)
- GitHub Check: Unit Tests (22)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Deploy-Preview
- GitHub Check: Verify generated types
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
- GitHub Check: Prettier Check (23)
- GitHub Check: Deploy-Preview
🔇 Additional comments (3)
apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx (3)
7-7
: LGTM: Translation hook import added correctly.The import follows Next.js i18n best practices for the
next-intl
library.🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 7-7: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L7
Added line #L7 was not covered by tests
19-19
: Good use of translation namespacing.Using the 'invite' namespace helps organize translation keys logically for workspace invitation features.
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 19-19: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L19
Added line #L19 was not covered by tests
23-38
:✅ Verification successful
Verify translation keys exist in translation files.
The translation implementation looks good with consistent kebab-case naming and logical organization. However, ensure all translation keys are defined in the translation files to prevent runtime errors.
🏁 Script executed:
#!/bin/bash # Description: Verify that all translation keys used in the component exist in translation files # Expected: All keys should be found in translation files echo "Searching for translation files..." fd -e json -e js -e ts . | grep -E "(locale|translation|i18n|intl)" | head -10 echo -e "\nSearching for 'invite' namespace translations..." rg -A 20 '"invite"' --type json echo -e "\nSearching for specific translation keys..." keys=("invited-to" "decline-invite" "accept-invite" "accept-invite-success-title" "accept-invite-success-msg" "accept-invite-error-title" "accept-invite-error-msg" "decline-invite-success-title" "decline-invite-success-msg" "decline-invite-error-title" "decline-invite-error-msg") for key in "${keys[@]}"; do echo "Checking key: $key" rg "$key" --type json || echo " ❌ Key '$key' not found" doneLength of output: 61365
All translation keys verified and present
The following translation files in apps/upskii contain all of the referenced keys, so there are no missing definitions:
- apps/upskii/messages/en.json
- apps/upskii/messages/vi.json
No further action is required.
🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 23-23: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L23
Added line #L23 was not covered by tests
[warning] 25-26: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L25-L26
Added lines #L25 - L26 were not covered by tests
[warning] 28-29: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L28-L29
Added lines #L28 - L29 were not covered by tests
[warning] 31-32: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L31-L32
Added lines #L31 - L32 were not covered by tests
[warning] 34-35: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L34-L35
Added lines #L34 - L35 were not covered by tests
[warning] 37-38: apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx#L37-L38
Added lines #L37 - L38 were not covered by tests
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.
LGTM! Thanks @VNOsST.
Summary by CodeRabbit