Add a new Vietnamese translation file to support Vietnamese language users#726
Add a new Vietnamese translation file to support Vietnamese language users#726MrgSub merged 4 commits intoMail-0:stagingfrom
Conversation
Add Vietnamese ('vi') to the list of supported languages in the
i18n configuration and JSON file to expand language options.
|
@ncdai is attempting to deploy a commit to the Zero Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThis change introduces Vietnamese language support to the mail application. It updates the language configuration to include Vietnamese, adds a comprehensive Vietnamese translation file for the application's UI with placeholder strings, and modifies the internationalization configuration to recognize Vietnamese as a supported locale. No existing logic or exported interfaces are altered, and the change is limited to language and localization configuration and resources. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MailApp
participant I18nConfig
User->>MailApp: Selects Vietnamese language
MailApp->>I18nConfig: Loads "vi" from LANGUAGES and i18n.json
MailApp->>MailApp: Loads vi.json translation strings
MailApp-->>User: Displays UI in Vietnamese
Possibly related PRs
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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:
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 (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
i18n.json (1)
22-23: Add Vietnamese locale to supported targets
The"vi"entry has been correctly appended to the"targets"array, enabling Vietnamese translations. Consider bumping the"version"field (currently1.5) to signal this update to downstream consumers.apps/mail/locales/vi.json (1)
1-450: Approve comprehensive Vietnamese translation file
This new locale JSON file appears to cover the full spectrum of UI strings. To maintain translation integrity, integrate an automated validation step (e.g., key‐presence checks against theen.jsonbaseline) into your CI pipeline.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/mail/i18n/config.ts(1 hunks)apps/mail/locales/vi.json(1 hunks)i18n.json(1 hunks)
| lv: 'Latvian', | ||
| hu: 'Hungarian', | ||
| fa: 'Farsi', | ||
| vi: 'Vietnamese', |
There was a problem hiding this comment.
Ensure consistency: missing Czech (cs) locale
You've added vi: 'Vietnamese' which is correct, but the cs (Czech) locale present in i18n.json is missing here. This will prevent Czech translations from being loaded. Please add:
const LANGUAGES = {
en: 'English',
ar: 'Arabic',
ca: 'Catalan',
+ cs: 'Czech',
de: 'German',
…
};📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| vi: 'Vietnamese', | |
| const LANGUAGES = { | |
| en: 'English', | |
| ar: 'Arabic', | |
| ca: 'Catalan', | |
| cs: 'Czech', | |
| de: 'German', | |
| … | |
| }; |
* draft fixes: - added cc and bcc when saving drafts - save drafts less aggresively * some fixes for saving attachments to draft * fix for empty draft loading * fix draft list recipient name/address * also show 'No Recipient' if empty * remove comments * switch to mimetext for draft saving to keep formatting consistent * add message title to draft list * feat: single api for oauth connections * fix: add extra error handling * chore: simplify and fix the dev env * Ai generate security (#706) * Create prompts with XML formatting * Include XML formatted prompts in generate func * remove unused regex and add helper functions/warnings * error handling * Update apps/mail/lib/prompts.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * lint issues * Update prompts.ts * #706 (comment) Coderabbit fix 1 * erabbitai bot 3 days ago⚠️ Potential issue errorOccurred state is stale inside finally React state setters (setErrorOccurred) are asynchronous; the errorOccurred value captured at render time will not yet reflect changes made earlier in the same event loop. Consequently, the logic deciding whether to collapse/expand may run with an outdated flag. - } finally { - setIsLoading(false); - if (!errorOccurred || isAskingQuestion) { - setIsExpanded(true); - } else { - setIsExpanded(false); // Collapse on errors - } - } + } finally { + setIsLoading(false); + // Use a local flag to track errors deterministically + const hadError = isAskingQuestion ? false : !!errorFlagRef.current; + setIsExpanded(!hadError); + } You can create const errorFlagRef = useRef(false); and update errorFlagRef.current = true every time an error is detected, ensuring reliable behaviour irrespective of React batching. Committable suggestion skipped: line range outside the PR's diff. * #706 (comment) * #706 (comment) * #706 (comment) --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Add a new Vietnamese translation file to support Vietnamese language users (#726) * feat(i18n): add Vietnamese language support Add Vietnamese ('vi') to the list of supported languages in the i18n configuration and JSON file to expand language options. * Add a new Vietnamese translation file to support Vietnamese language users. * Clear Vietnamese translation strings * Update es.json (#710) Co-authored-by: needle <122770437+needleXO@users.noreply.github.com> * Update app manifest and add new icons for PWA (#739) * feat: allow sending from email aliases added through gmail (#743) * Refactor IP handling in early-access routes * Add unauthorized error handling in sign out function --------- Co-authored-by: Ahmet Kilinc <akx9@icloud.com> Co-authored-by: BlankParticle <blankparticle@gmail.com> Co-authored-by: grim <75869731+ripgrim@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Chánh Đại <dai@chanhdai.com> Co-authored-by: Dani B. <danibaldomirm@gmail.com> Co-authored-by: needle <122770437+needleXO@users.noreply.github.com> Co-authored-by: Humber Nieto <56887259+humbernieto@users.noreply.github.com> Co-authored-by: Atharva Deosthale <atharva.deosthale17@gmail.com>
* draft fixes: - added cc and bcc when saving drafts - save drafts less aggresively * some fixes for saving attachments to draft * fix for empty draft loading * fix draft list recipient name/address * also show 'No Recipient' if empty * remove comments * switch to mimetext for draft saving to keep formatting consistent * add message title to draft list * feat: single api for oauth connections * fix: add extra error handling * chore: simplify and fix the dev env * Ai generate security (#706) * Create prompts with XML formatting * Include XML formatted prompts in generate func * remove unused regex and add helper functions/warnings * error handling * Update apps/mail/lib/prompts.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * lint issues * Update prompts.ts * #706 (comment) Coderabbit fix 1 * erabbitai bot 3 days ago⚠️ Potential issue errorOccurred state is stale inside finally React state setters (setErrorOccurred) are asynchronous; the errorOccurred value captured at render time will not yet reflect changes made earlier in the same event loop. Consequently, the logic deciding whether to collapse/expand may run with an outdated flag. - } finally { - setIsLoading(false); - if (!errorOccurred || isAskingQuestion) { - setIsExpanded(true); - } else { - setIsExpanded(false); // Collapse on errors - } - } + } finally { + setIsLoading(false); + // Use a local flag to track errors deterministically + const hadError = isAskingQuestion ? false : !!errorFlagRef.current; + setIsExpanded(!hadError); + } You can create const errorFlagRef = useRef(false); and update errorFlagRef.current = true every time an error is detected, ensuring reliable behaviour irrespective of React batching. Committable suggestion skipped: line range outside the PR's diff. * #706 (comment) * #706 (comment) * #706 (comment) --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Add a new Vietnamese translation file to support Vietnamese language users (#726) * feat(i18n): add Vietnamese language support Add Vietnamese ('vi') to the list of supported languages in the i18n configuration and JSON file to expand language options. * Add a new Vietnamese translation file to support Vietnamese language users. * Clear Vietnamese translation strings * Update es.json (#710) Co-authored-by: needle <122770437+needleXO@users.noreply.github.com> * Update app manifest and add new icons for PWA (#739) * feat: allow sending from email aliases added through gmail (#743) * Refactor IP handling in early-access routes * Add unauthorized error handling in sign out function * Redirect from Home Page on Session (#701) * Updated lockfile * Updated home page session validation --------- Co-authored-by: Adam <x_1337@outlook.com> * Refactor settings handling and golden ticket logic * Feat: og:image Generation on /compose route (#730) * Create route og image * resolve coderabbit nitpicks --------- Co-authored-by: Adam <x_1337@outlook.com> * Update session check to include user id before redirecting * Fix unauthorized error handling in multiple actions * Enable shortcuts settings in navigation * Refactor error handling to return unauthorized gracefully * Update Hero component with new imports and link adjustments * Update redirect URL to use hostname from req object * Fix redirect URL formatting and add log for missing user ID * Fix error handling in API routes for unauthorized requests * Refactor throwUnauthorizedGracefully function for readability * Fix error handling in driver routes * Handle unauthorized gracefully when getting connections * Refactor mail actions for better error handling * Refactor deleteActiveConnection function for readability * fixed (#752) * Refactor error handling in mail actions to return null or specific error messages instead of throwing unauthorized errors. This improves readability and maintains functionality across various actions. * Update Google auth provider configuration * Delete connection and update hero text * Refactor error handling to use StandardizedError class * Refactor error handling for Google API driver --------- Co-authored-by: Ahmet Kilinc <akx9@icloud.com> Co-authored-by: BlankParticle <blankparticle@gmail.com> Co-authored-by: grim <75869731+ripgrim@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Chánh Đại <dai@chanhdai.com> Co-authored-by: Dani B. <danibaldomirm@gmail.com> Co-authored-by: needle <122770437+needleXO@users.noreply.github.com> Co-authored-by: Humber Nieto <56887259+humbernieto@users.noreply.github.com> Co-authored-by: Atharva Deosthale <atharva.deosthale17@gmail.com> Co-authored-by: Nikita Drokin <86173808+nikitadrokin@users.noreply.github.com>
* draft fixes: - added cc and bcc when saving drafts - save drafts less aggresively * some fixes for saving attachments to draft * fix for empty draft loading * fix draft list recipient name/address * also show 'No Recipient' if empty * remove comments * switch to mimetext for draft saving to keep formatting consistent * add message title to draft list * feat: single api for oauth connections * fix: add extra error handling * chore: simplify and fix the dev env * Ai generate security (#706) * Create prompts with XML formatting * Include XML formatted prompts in generate func * remove unused regex and add helper functions/warnings * error handling * Update apps/mail/lib/prompts.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * lint issues * Update prompts.ts * #706 (comment) Coderabbit fix 1 * erabbitai bot 3 days ago⚠️ Potential issue errorOccurred state is stale inside finally React state setters (setErrorOccurred) are asynchronous; the errorOccurred value captured at render time will not yet reflect changes made earlier in the same event loop. Consequently, the logic deciding whether to collapse/expand may run with an outdated flag. - } finally { - setIsLoading(false); - if (!errorOccurred || isAskingQuestion) { - setIsExpanded(true); - } else { - setIsExpanded(false); // Collapse on errors - } - } + } finally { + setIsLoading(false); + // Use a local flag to track errors deterministically + const hadError = isAskingQuestion ? false : !!errorFlagRef.current; + setIsExpanded(!hadError); + } You can create const errorFlagRef = useRef(false); and update errorFlagRef.current = true every time an error is detected, ensuring reliable behaviour irrespective of React batching. Committable suggestion skipped: line range outside the PR's diff. * #706 (comment) * #706 (comment) * #706 (comment) --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Add a new Vietnamese translation file to support Vietnamese language users (#726) * feat(i18n): add Vietnamese language support Add Vietnamese ('vi') to the list of supported languages in the i18n configuration and JSON file to expand language options. * Add a new Vietnamese translation file to support Vietnamese language users. * Clear Vietnamese translation strings * Update es.json (#710) Co-authored-by: needle <122770437+needleXO@users.noreply.github.com> * Update app manifest and add new icons for PWA (#739) * feat: allow sending from email aliases added through gmail (#743) * Refactor IP handling in early-access routes * Add unauthorized error handling in sign out function * Redirect from Home Page on Session (#701) * Updated lockfile * Updated home page session validation --------- Co-authored-by: Adam <x_1337@outlook.com> * Refactor settings handling and golden ticket logic * Feat: og:image Generation on /compose route (#730) * Create route og image * resolve coderabbit nitpicks --------- Co-authored-by: Adam <x_1337@outlook.com> * Update session check to include user id before redirecting * Fix unauthorized error handling in multiple actions * Enable shortcuts settings in navigation * Refactor error handling to return unauthorized gracefully * Update Hero component with new imports and link adjustments * Update redirect URL to use hostname from req object * Fix redirect URL formatting and add log for missing user ID * Fix error handling in API routes for unauthorized requests * Refactor throwUnauthorizedGracefully function for readability * Fix error handling in driver routes * Handle unauthorized gracefully when getting connections * Refactor mail actions for better error handling * Refactor deleteActiveConnection function for readability * fixed (#752) * Refactor error handling in mail actions to return null or specific error messages instead of throwing unauthorized errors. This improves readability and maintains functionality across various actions. * Update Google auth provider configuration * Delete connection and update hero text * Refactor error handling to use StandardizedError class * Refactor error handling for Google API driver * Add labels to sidebar, labels settings and useLabels hook (#746) * Adds labels from the provider: - labels page in settings - labels page translations - added labels for google provider * useLabels and labels in sidebar * fix rate limit parts of labels route * Added labels to mail-list * - add rate limiting - move useThreadsLabel --------- Co-authored-by: Adam <x_1337@outlook.com> * bin count of unread messages * dixes drafts not saving persistently * dont show from field is no aliases * limited height of attachment dialog * added delete page * correct way to delete accounts * - adds new revokeRefreshToken method to Google driver - updates lib/auth.ts to use the new method - updates actions/user.ts - updates app/(routes)/settings/danger-zone/page.tsx * Add posthog-js dependency and implement label filtering in NavMain component - Added posthog-js version 1.236.6 to package.json and bun.lock. - Introduced search functionality by implementing handleFilterByLabel in NavMain component. - Updated NavItem to trigger label filtering on click. * Enhance NavItem component to support onClick event handling - Updated NavItem to include an onClick prop for the Link component, allowing for custom click behavior. - Maintained existing functionality with prefetch and target attributes. --------- Co-authored-by: Ahmet Kilinc <akx9@icloud.com> Co-authored-by: BlankParticle <blankparticle@gmail.com> Co-authored-by: grim <75869731+ripgrim@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Chánh Đại <dai@chanhdai.com> Co-authored-by: Dani B. <danibaldomirm@gmail.com> Co-authored-by: needle <122770437+needleXO@users.noreply.github.com> Co-authored-by: Humber Nieto <56887259+humbernieto@users.noreply.github.com> Co-authored-by: Atharva Deosthale <atharva.deosthale17@gmail.com> Co-authored-by: Nikita Drokin <86173808+nikitadrokin@users.noreply.github.com> Co-authored-by: Adarsh Tiwari <adarshtiwari797023@gmail.com>
* draft fixes: - added cc and bcc when saving drafts - save drafts less aggresively * some fixes for saving attachments to draft * fix for empty draft loading * fix draft list recipient name/address * also show 'No Recipient' if empty * remove comments * switch to mimetext for draft saving to keep formatting consistent * add message title to draft list * feat: single api for oauth connections * fix: add extra error handling * chore: simplify and fix the dev env * Ai generate security (#706) * Create prompts with XML formatting * Include XML formatted prompts in generate func * remove unused regex and add helper functions/warnings * error handling * Update apps/mail/lib/prompts.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * lint issues * Update prompts.ts * #706 (comment) Coderabbit fix 1 * erabbitai bot 3 days ago⚠️ Potential issue errorOccurred state is stale inside finally React state setters (setErrorOccurred) are asynchronous; the errorOccurred value captured at render time will not yet reflect changes made earlier in the same event loop. Consequently, the logic deciding whether to collapse/expand may run with an outdated flag. - } finally { - setIsLoading(false); - if (!errorOccurred || isAskingQuestion) { - setIsExpanded(true); - } else { - setIsExpanded(false); // Collapse on errors - } - } + } finally { + setIsLoading(false); + // Use a local flag to track errors deterministically + const hadError = isAskingQuestion ? false : !!errorFlagRef.current; + setIsExpanded(!hadError); + } You can create const errorFlagRef = useRef(false); and update errorFlagRef.current = true every time an error is detected, ensuring reliable behaviour irrespective of React batching. Committable suggestion skipped: line range outside the PR's diff. * #706 (comment) * #706 (comment) * #706 (comment) --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Add a new Vietnamese translation file to support Vietnamese language users (#726) * feat(i18n): add Vietnamese language support Add Vietnamese ('vi') to the list of supported languages in the i18n configuration and JSON file to expand language options. * Add a new Vietnamese translation file to support Vietnamese language users. * Clear Vietnamese translation strings * Update es.json (#710) Co-authored-by: needle <122770437+needleXO@users.noreply.github.com> * Update app manifest and add new icons for PWA (#739) * feat: allow sending from email aliases added through gmail (#743) * Refactor IP handling in early-access routes * Add unauthorized error handling in sign out function * Redirect from Home Page on Session (#701) * Updated lockfile * Updated home page session validation --------- Co-authored-by: Adam <x_1337@outlook.com> * Refactor settings handling and golden ticket logic * Feat: og:image Generation on /compose route (#730) * Create route og image * resolve coderabbit nitpicks --------- Co-authored-by: Adam <x_1337@outlook.com> * Update session check to include user id before redirecting * Fix unauthorized error handling in multiple actions * Enable shortcuts settings in navigation * Refactor error handling to return unauthorized gracefully * Update Hero component with new imports and link adjustments * Update redirect URL to use hostname from req object * Fix redirect URL formatting and add log for missing user ID * Fix error handling in API routes for unauthorized requests * Refactor throwUnauthorizedGracefully function for readability * Fix error handling in driver routes * Handle unauthorized gracefully when getting connections * Refactor mail actions for better error handling * Refactor deleteActiveConnection function for readability * fixed (#752) * Refactor error handling in mail actions to return null or specific error messages instead of throwing unauthorized errors. This improves readability and maintains functionality across various actions. * Update Google auth provider configuration * Delete connection and update hero text * Refactor error handling to use StandardizedError class * Refactor error handling for Google API driver * Add labels to sidebar, labels settings and useLabels hook (#746) * Adds labels from the provider: - labels page in settings - labels page translations - added labels for google provider * useLabels and labels in sidebar * fix rate limit parts of labels route * Added labels to mail-list * - add rate limiting - move useThreadsLabel --------- Co-authored-by: Adam <x_1337@outlook.com> * bin count of unread messages * dixes drafts not saving persistently * dont show from field is no aliases * limited height of attachment dialog * added delete page * correct way to delete accounts * - adds new revokeRefreshToken method to Google driver - updates lib/auth.ts to use the new method - updates actions/user.ts - updates app/(routes)/settings/danger-zone/page.tsx * Add posthog-js dependency and implement label filtering in NavMain component - Added posthog-js version 1.236.6 to package.json and bun.lock. - Introduced search functionality by implementing handleFilterByLabel in NavMain component. - Updated NavItem to trigger label filtering on click. * Enhance NavItem component to support onClick event handling - Updated NavItem to include an onClick prop for the Link component, allowing for custom click behavior. - Maintained existing functionality with prefetch and target attributes. * fix: add missing dompurify dep (#765) * user can edit enail after selecting (#760) * User can able to delete from bin (#670) * delete mails permanently from bin * add English translations for delete mail actions * update the call handleDelete * fixed handle delete function * handleDelete call * enhance handledelete to reset bulk selection after deletion * removed the scope * delete mails permanently from bin * add English translations for delete mail actions * update the call handleDelete * handleDelete call * enhance handledelete to reset bulk selection after deletion * removed the scope --------- Co-authored-by: Ahmet Kilinc <akx9@icloud.com> Co-authored-by: Adam <x_1337@outlook.com> * send draft instead of new message (#767) * Add sendDraft method to Gmail driver and MailManager interface * fix sendDraft method * Add support for sending draft emails and clear draftId after sending --------- Co-authored-by: Adam <x_1337@outlook.com> * Add Chinese language support for mail app * Update email addresses in send function * Add import statement for deleteActiveConnection function --------- Co-authored-by: Ahmet Kilinc <akx9@icloud.com> Co-authored-by: BlankParticle <blankparticle@gmail.com> Co-authored-by: grim <75869731+ripgrim@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Chánh Đại <dai@chanhdai.com> Co-authored-by: Dani B. <danibaldomirm@gmail.com> Co-authored-by: needle <122770437+needleXO@users.noreply.github.com> Co-authored-by: Humber Nieto <56887259+humbernieto@users.noreply.github.com> Co-authored-by: Atharva Deosthale <atharva.deosthale17@gmail.com> Co-authored-by: Nikita Drokin <86173808+nikitadrokin@users.noreply.github.com> Co-authored-by: Adarsh Tiwari <adarshtiwari797023@gmail.com> Co-authored-by: Adarsh Tiwari <134617221+Adarsh9977@users.noreply.github.com>
Description
Add Vietnamese (
vi) to the list of supported languages in the i18n configuration and JSON file to expand language options.Type of Change
Please delete options that are not relevant.
Areas Affected
Please check all that apply:
Testing Done
Describe the tests you've done:
Security Considerations
For changes involving data or authentication:
Checklist
Additional Notes
Screenshots/Recordings
By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.
Summary by CodeRabbit