fix: remove em dashes, fix mojibake, fix claim toast UUID, fix notifi…#92
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR standardizes punctuation/encoding across the app (removing em dashes and fixing mojibake), adjusts notification/unread labeling, and refines donation-claim UX (skip “claimed” toasts for self-claims and add a success toast on claim). It also aligns the notifications backend controller with the JWT strategy’s req.user.userId shape.
Changes:
- Replace em dashes / mojibake characters across frontend/backend strings and comments.
- Update donation-claimed toast behavior (skip self-claim alerts; add claim success toast).
- Fix notifications controller to use
req.user.userIdand adjust unread label template across locales.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/services/translationService.ts | Normalize comment punctuation in cache write error handling. |
| frontend/src/services/socket.ts | Normalize comment punctuation for connection reuse. |
| frontend/src/services/api.ts | Normalize comment punctuation near auth interceptor + notifications types. |
| frontend/src/pages/dashboard/Profile.tsx | Normalize comment punctuation in badge guide note. |
| frontend/src/pages/dashboard/NGODashboard.tsx | Skip claim-alert toast for own claims; add claim success toast; normalize punctuation in a verification message. |
| frontend/src/pages/dashboard/Impact.tsx | Normalize comment punctuation in section headers. |
| frontend/src/pages/dashboard/History.tsx | Normalize comment punctuation for tab toggle note. |
| frontend/src/pages/dashboard/FeedbackRatings.tsx | Replace em dash separator in option label. |
| frontend/src/pages/dashboard/DiscoveryMap.tsx | Skip claim-alert toast for own claims; add claim success toast; normalize punctuation in verification message. |
| frontend/src/pages/dashboard/AdminDashboard.tsx | Normalize toast strings to use hyphen instead of em dash. |
| frontend/src/pages/LandingPage.tsx | Normalize comment punctuation near role config data note. |
| frontend/src/locales/ta.ts | Normalize punctuation in Tamil strings; adjust unread label template. |
| frontend/src/locales/hi.ts | Normalize punctuation in Hindi strings; adjust unread label template (and introduce a Hindi typo that should be fixed). |
| frontend/src/i18n.ts | Fix mojibake in English source strings; adjust unread label template and normalize punctuation. |
| frontend/src/tests/pages/dashboard/AdminDashboard.test.tsx | Update test expectation to match updated toast string. |
| frontend/src/App.css | Normalize comment punctuation. |
| frontend/playwright.config.ts | Normalize comment punctuation regarding test parallelism. |
| frontend/e2e/donation-lifecycle.spec.ts | Normalize comment punctuation in E2E flow. |
| backend/test/realtime-events.e2e-spec.ts | Normalize comment punctuation in latency/skip notes. |
| backend/src/scripts/backup_db.sh | Normalize comment punctuation in backup rotation note. |
| backend/src/notifications/notifications.controller.ts | Switch from req.user.sub to req.user.userId to match JWT strategy. |
| backend/src/common/email.service.ts | Normalize log message/comment punctuation. |
| backend/src/common/cloudinary.service.ts | Normalize log message punctuation for mock mode. |
| backend/src/auth/tests/jwt-security.spec.ts | Normalize comment punctuation in JWT security tests. |
| backend/src/auth/entities/user.entity.ts | Normalize comment punctuation for timestamps note. |
| backend/src/auth/auth.service.ts | Normalize comment punctuation for shared badge catalog note. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| try { | ||
| await claimDonation(donationId) | ||
| toast.success(`✅ ${t('foodClaimedAlert')}`, { | ||
| description: `${donationName} has been claimed successfully`, |
There was a problem hiding this comment.
This new success toast description ("has been claimed successfully") is hardcoded in English. Please localize it (e.g., add an i18n key and pass donationName via interpolation) to keep the UI consistently translated.
| description: `${donationName} has been claimed successfully`, | |
| description: t('donationClaimedSuccessDescription', { donationName }), |
| if (data.claimedBy !== user.id) { | ||
| const name = claimedDonation ? claimedDonation.name : 'A donation'; | ||
| toast.info(`🔔 ${t('foodClaimedAlert')}`, { | ||
| description: `${name} has been claimed`, |
There was a problem hiding this comment.
The toast description string here is hardcoded in English ("has been claimed"). Since the title uses t('foodClaimedAlert'), consider localizing the description as well (i18n key + {{name}} interpolation) for full translation coverage.
| description: `${name} has been claimed`, | |
| description: t('foodClaimedDescription', { name }), |
| try { | ||
| await claimDonation(donationId) | ||
| toast.success(`✅ ${t('foodClaimedAlert')}`, { | ||
| description: `${donationName} has been claimed successfully`, |
There was a problem hiding this comment.
This new success toast description ("has been claimed successfully") is hardcoded in English. Please localize it (new i18n key with {{name}} interpolation) so the confirmation message is translated.
| description: `${donationName} has been claimed successfully`, | |
| description: t('donationClaimedDescription', { name: donationName }), |
| pointsToGo: '{{points}} पॉइंट्स बाकी', | ||
| allBadgesUnlocked: 'सभी बैज अनलॉक हो गए! आप सुपरहीरो हैं!', | ||
| communityImpact: 'सामुदायिक प्रभाव — प्लेटफ़ॉर्म व्यापी', | ||
| communityImpact: 'सामुदायिक प्रभाव - प्लेटृफ़ॉर्म व्यापी', |
There was a problem hiding this comment.
There appears to be a typo in this Hindi string: "प्लेटृफ़ॉर्म" is inconsistent with other occurrences in this file (e.g. platformDirector: 'प्लेटफ़ॉर्म निदेशक'). It likely should be "प्लेटफ़ॉर्म".
| communityImpact: 'सामुदायिक प्रभाव - प्लेटृफ़ॉर्म व्यापी', | |
| communityImpact: 'सामुदायिक प्रभाव - प्लेटफ़ॉर्म व्यापी', |
| if (data.claimedBy !== user.id) { | ||
| const name = claimedDonation ? claimedDonation.name : 'A donation'; | ||
| toast.info(`🔔 ${t('foodClaimedAlert')}`, { | ||
| description: `${name} has been claimed`, |
There was a problem hiding this comment.
The toast description string here is hardcoded in English ("has been claimed"). Since the title is localized via t('foodClaimedAlert'), consider localizing the description too (e.g., via an i18n key with {{name}} interpolation) so non-English users get a fully translated notification.
| description: `${name} has been claimed`, | |
| description: t('foodClaimedDescription', { name }), |
…cation read persistence, fix unread count template
e7fda21 to
67403d2
Compare
…cation read persistence, fix unread count template