Skip to content
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

Fixing text translation for vouched users #4882

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

kkatusic
Copy link
Collaborator

@kkatusic kkatusic commented Nov 28, 2024

Summary by CodeRabbit

  • New Features

    • Added new translation entries for GIVbacks eligibility notifications in English, Catalan, and Spanish.
    • Introduced a new <ProjectCardNotification /> component for consistent notifications across mobile and desktop views.
  • Bug Fixes

    • Updated messaging for verified project owners regarding incomplete GIVbacks applications to enhance clarity.
  • Documentation

    • Improved existing translation strings for grammatical accuracy and user understanding across multiple languages.

@kkatusic kkatusic self-assigned this Nov 28, 2024
Copy link

vercel bot commented Nov 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
giveth-dapps-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2024 7:20pm

Copy link
Contributor

coderabbitai bot commented Nov 28, 2024

Walkthrough

The changes in this pull request involve updates to localization files for Catalan, English, and Spanish, specifically adding and modifying translation entries related to the GIVbacks program. A new description entry was introduced for verified project owners with incomplete GIVbacks applications, providing clearer guidance on completing their eligibility applications. Additionally, modifications were made to the ProjectGIVbackToast component to reflect these changes in messaging, and the AdminActions component was updated to ensure consistent notification display across mobile and desktop views.

Changes

File Path Change Summary
lang/ca.json Added new translation entry for GIVbacks eligibility notification for verified owners with incomplete applications.
lang/en.json Added new translation key for GIVbacks eligibility toast; updated existing strings for clarity and grammatical accuracy.
lang/es.json Added new translation key for GIVbacks eligibility notification; updated existing keys for improved clarity and accuracy.
src/components/views/project/ProjectGIVbackToast.tsx Modified logic for displaying eligibility message for verified owners with incomplete GIVbacks applications.
src/components/views/project/projectActionCard/AdminActions.tsx Added <ProjectCardNotification /> component to ensure consistent notification display in both mobile and desktop views.

Possibly related PRs

Suggested labels

Code Review

Suggested reviewers

  • MohammadPCh
  • CarlosQ96

Poem

🐰 In the fields where projects grow,
GIVbacks help them shine and glow.
With messages clear, we guide the way,
Complete your forms, don’t delay!
A hop, a skip, let’s celebrate,
For every project, it’s never too late! 🌼


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?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

🧹 Outside diff range and nitpick comments (3)
src/components/views/project/projectActionCard/AdminActions.tsx (1)

183-183: Consider unifying notification placement.

To maintain consistent behavior across viewports, consider either:

  1. Moving both notifications inside their respective wrappers, or
  2. Moving both notifications outside their respective wrappers

This would ensure that opacity and pointer-events are handled uniformly.

 const AdminActions = () => {
   // ... existing code ...
   return !isMobile ? (
     <>
       {!isAdminEmailVerified && (
         <VerifyNotification>
           {formatMessage({
             id: 'label.email_actions_text',
           })}
         </VerifyNotification>
       )}
+      <ProjectCardNotification />
       <Wrapper $verified={isAdminEmailVerified}>
         <Dropdown
           style={dropdownStyle}
           label='Project Actions'
           options={options}
         />
         {/* ... modals ... */}
-        <ProjectCardNotification />
       </Wrapper>
     </>
   ) : (
     <>
       {/* ... mobile view ... */}
     </>
   );
 };

Also applies to: 246-246

src/components/views/project/ProjectGIVbackToast.tsx (1)

Line range hint 52-57: Improve condition naming and documentation

The condition correctly identifies verified owners with incomplete GIVbacks forms, but could be more explicit:

Consider these improvements:

-// When project is VOUCHED (verified=true), not givbacks eligible AND has incomplete givbacks form we should show this notification
-const isOwnerVerifiedNotEligible =
+// When a verified project owner hasn't completed their GIVbacks eligibility form
+const isOwnerVerifiedWithIncompleteGivbacksForm =
     isVerified &&
     isAdmin &&
     !isGivbackEligible &&
     projectData.verificationFormStatus !== EVerificationStatus.VERIFIED;

This makes the condition's purpose clearer and aligns better with the new translation key.

lang/en.json (1)

1685-1685: Text could be more concise and consistent

The translation text is functional but could be improved for clarity and consistency.

Consider this revision:

-	"project.givback_toast.description.verified_owner_not_eligible_not_form": "Boost your project to increase its GIVbacks percentage and help it appear higher on the projects page! Additionally, your GIVbacks application form is incomplete. Please complete your GIVbacks Eligibility application for the Giveth team to review.",
+	"project.givback_toast.description.verified_owner_not_eligible_not_form": "Boost your project to increase its GIVbacks percentage and visibility on the projects page. Your GIVbacks Eligibility application is incomplete - please complete it for review by the Giveth team.",

The suggested revision:

  • Removes redundant wording ("help it appear" vs just "visibility")
  • Makes the incomplete form notice more direct
  • Maintains consistent terminology with other toast messages
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 511b7f9 and 9c02868.

📒 Files selected for processing (5)
  • lang/ca.json (1 hunks)
  • lang/en.json (1 hunks)
  • lang/es.json (1 hunks)
  • src/components/views/project/ProjectGIVbackToast.tsx (1 hunks)
  • src/components/views/project/projectActionCard/AdminActions.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • lang/ca.json
🔇 Additional comments (3)
src/components/views/project/projectActionCard/AdminActions.tsx (1)

183-183: Verify notification behavior consistency.

The notification component is placed differently in desktop (inside Wrapper) vs mobile (outside MobileWrapper) views. This might lead to inconsistent behavior when the admin email is not verified, as the desktop notification inherits opacity and pointer-events from the wrapper while the mobile one doesn't.

src/components/views/project/ProjectGIVbackToast.tsx (1)

198-198: LGTM! Verify translation key exists

The translation key change better reflects the specific case where a verified owner hasn't completed their GIVbacks form. This aligns with the PR's objective of fixing text translations for vouched users.

Let's verify the translation key exists in all language files:

✅ Verification successful

Translation key verified in all language files

The new translation key verified_owner_not_eligible_not_form exists with appropriate translations in all language files (en.json, es.json, and ca.json). The translations correctly convey the message about boosting the project and completing the GIVbacks eligibility form.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new translation key exists in all language files
# Expected: The key should exist in en.json, es.json, and ca.json

for lang in en es ca; do
  echo "Checking ${lang}.json:"
  rg "verified_owner_not_eligible_not_form" "lang/${lang}.json"
done

Length of output: 1432

lang/es.json (1)

1685-1685: LGTM! Translation addition is consistent and clear.

The new translation key project.givback_toast.description.verified_owner_not_eligible_not_form is well-formatted and provides clear guidance in Spanish about boosting projects and completing GIVbacks eligibility forms.

Let's verify the translation key exists in other language files:

✅ Verification successful

Translation key is consistent across language files

The new Spanish translation key project.givback_toast.description.verified_owner_not_eligible_not_form exists in both English (en.json) and Catalan (ca.json) files with equivalent messaging and proper formatting. The translations maintain consistent meaning across all three languages while preserving language-specific grammar and vocabulary.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new translation key exists in other language files
# Expected: The key should exist in en.json and ca.json

rg "project\.givback_toast\.description\.verified_owner_not_eligible_not_form" "lang/en.json" "lang/ca.json"

Length of output: 831

@kkatusic kkatusic merged commit c69457a into develop Nov 29, 2024
3 checks passed
@kkatusic kkatusic deleted the feat/allow_boost_own_project branch November 29, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: QA
Development

Successfully merging this pull request may close these issues.

2 participants