Skip to content

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

Merged
merged 2 commits into from
Jun 9, 2025
Merged

Conversation

VNOsST
Copy link
Collaborator

@VNOsST VNOsST commented Jun 9, 2025

Summary by CodeRabbit

  • New Features
    • All workspace invitation notifications now support multiple languages, displaying text according to your selected locale.
    • Workspace invitation links now direct you to the workspace home page for quicker access.

Copy link

graphite-app bot commented Jun 9, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

Copy link
Contributor

coderabbitai bot commented Jun 9, 2025

Walkthrough

All 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 /${ws.id} to /${ws.id}/home.

Changes

File(s) Change Summary
apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx Replaced hardcoded UI strings with translation function calls; added import for translation hook; updated workspace link URL path.

Poem

In every tongue, an invite gleams,
With words that shift like flowing streams.
Now workspace calls in every land,
A rabbit’s code, both neat and grand.
🌍✨

“Come join us!”—now in every voice,
The world’s invited to rejoice!

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/upskii/src/components/notifications/WorkspaceInviteSnippet.tsx

Oops! Something went wrong! :(

ESLint: 9.28.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@typescript-eslint/parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jun 9, 2025

Codecov Report

Attention: Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.

Project coverage is 0.84%. Comparing base (c1de4e8) to head (17a63b0).
Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
...omponents/notifications/WorkspaceInviteSnippet.tsx 0.00% 16 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@VNOsST VNOsST marked this pull request as ready for review June 9, 2025 05:25
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 the invite 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

📥 Commits

Reviewing files that changed from the base of the PR and between c1de4e8 and fad5aa3.

📒 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 of useTranslations is correct.

Adding useTranslations here enables hooking into the invite 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 matching invite translation file (e.g. locales/<locale>/invite.json) so this hook can resolve your keys.

@VNOsST VNOsST self-assigned this Jun 9, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between fad5aa3 and 17a63b0.

📒 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"
done

Length 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

Copy link
Member

@vhpx vhpx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @VNOsST.

@vhpx vhpx merged commit 75dc445 into main Jun 9, 2025
19 checks passed
@vhpx vhpx deleted the feat/workspace-invitations branch June 9, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants