Skip to content

[WEB-3732 | WEB-3731] feat: Vietnamese and Portuguese language support#6854

Merged
sriramveeraghanta merged 4 commits intopreviewfrom
feat-vietnamese-and-portuguese-language-support
Apr 1, 2025
Merged

[WEB-3732 | WEB-3731] feat: Vietnamese and Portuguese language support#6854
sriramveeraghanta merged 4 commits intopreviewfrom
feat-vietnamese-and-portuguese-language-support

Conversation

@anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Apr 1, 2025

Description

This PR includes following language support:

  • Vietnamese
  • Portuguese

Type of Change

  • Feature

References

[WEB-3732 | WEB-3731]

Summary by CodeRabbit

  • New Features
    • Expanded supported languages with the addition of Portuguese (Brazil) and Vietnamese, enhancing localization.
    • Introduced comprehensive translation support for user interface elements, authentication flows, notifications, and workspace management.
    • Updated the language loader to include the new language options.
    • Enhanced language type definitions to recognize the new language codes.

hpflatorre and others added 4 commits April 1, 2025 15:16
Updated TranslationStore to include support for Brazilian Portuguese by importing the corresponding translations file.
Extended TLanguage type to include "pt-BR" as a valid language option.
- Added Vietnamese (Tiếng việt) to the list of supported languages.
- Created a new translations file for Vietnamese with comprehensive translations for various UI elements.
- Updated the TranslationStore to include the new Vietnamese language option.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 1, 2025

Walkthrough

The pull request extends the application's internationalization support by adding two new languages: Brazilian Portuguese and Vietnamese. Updates include modifying the language configuration arrays and types, incorporating new translation JSON files for both languages, and updating the translation store's file import logic to handle the new options.

Changes

File(s) Change Summary
packages/i18n/src/constants/language.ts
packages/i18n/src/types/language.ts
Updated language configuration by adding "pt-BR" and "vi-VN" to the supported languages and union type.
packages/i18n/src/store/index.ts Extended the importLanguageFile method to include cases for "pt-BR" and "vi-VN", enabling the dynamic import of new translation files.
packages/i18n/src/locales/pt-BR/translations.json
packages/i18n/src/locales/vi-VN/translations.json
Added new JSON translation files providing localized text for various UI elements for Brazilian Portuguese and Vietnamese.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant LS as Language Selector
    participant TS as TranslationStore
    participant TF as Translation File

    U->>LS: Select "pt-BR" or "vi-VN"
    LS->>TS: Request translation file for selected language
    TS->>TF: Import "../locales/{selected_language}/translations.json"
    TF-->>TS: Return translation data
    TS-->>LS: Deliver localized content
    LS-->>U: Render localized UI
Loading

Possibly related PRs

Suggested labels

🌐frontend, 🌟enhancement

Suggested reviewers

  • sriramveeraghanta

Poem

I'm a hopping rabbit in a code so bright,
Adding new languages in the soft moonlight.
Portuguese and Vietnamese join the race,
Bringing diverse words with a gentle grace.
With a joyful leap and a twitch of my ear,
I celebrate changes and spread a cheer! 🐇🎉

✨ 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.
    • 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

@makeplane
Copy link

makeplane bot commented Apr 1, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

@anmolsinghbhatia anmolsinghbhatia marked this pull request as ready for review April 1, 2025 10:51
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 (4)
packages/i18n/src/constants/language.ts (1)

20-20: LGTM: Added Portuguese and Vietnamese language support

The new language entries follow the correct format with appropriate ISO language codes. For Vietnamese, consider capitalizing "việt" to "Việt" in the label to follow standard convention for the language name.

- { label: "Tiếng việt", value: "vi-VN" },
+ { label: "Tiếng Việt", value: "vi-VN" },

Also applies to: 23-23

packages/i18n/src/locales/pt-BR/translations.json (3)

1-20: Sidebar Translations Consistency
The sidebar section is well-structured and most entries are properly translated. However, note the key "inbox" is still set to "Inbox". For consistency with the rest of the Portuguese translations (e.g. later using “Caixa de entrada” in notifications), you might consider updating this entry.

Below is a diff suggestion if you decide to localize this term completely:

-"inbox": "Inbox",
+"inbox": "Caixa de entrada",

92-115: Empty Sub-header in Sign-Up Email Step
In the "sign_up" section, under the "email" step, the "sub_header" is an empty string. If this is not intentional, consider adding a descriptive sub-header or remove the key to maintain consistency across different sign-up steps.


1-2374: Overall Translation File Quality and Consistency
This new translation file is extensive and covers a wide array of UI elements in a detailed and organized manner. The JSON structure is valid and the key-value pairs are logical. A few suggestions:

  • Verify with native speakers that all terms (especially technical or branded terms like "Home", "Analytics", and "Workspace") match the intended tone and context.
  • Ensure consistency in terminology (for instance, as noted in the sidebar, consider whether some entries should be fully translated).
  • Maintain uniform punctuation and capitalization practices throughout the file for a polished end-user experience.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 921dfe3 and 5854328.

📒 Files selected for processing (5)
  • packages/i18n/src/constants/language.ts (1 hunks)
  • packages/i18n/src/locales/pt-BR/translations.json (1 hunks)
  • packages/i18n/src/locales/vi-VN/translations.json (1 hunks)
  • packages/i18n/src/store/index.ts (1 hunks)
  • packages/i18n/src/types/language.ts (1 hunks)
🔇 Additional comments (4)
packages/i18n/src/types/language.ts (1)

16-19: LGTM: Updated type definition to include new languages

The type definition is properly updated to include the new language codes. The union type formatting is correct, with the semicolon properly placed only at the end of the last entry.

packages/i18n/src/store/index.ts (1)

168-169: LGTM: Updated importLanguageFile method for new languages

The switch statement is properly updated to handle the new language codes, with correct import paths to the corresponding translation files.

Also applies to: 174-175

packages/i18n/src/locales/vi-VN/translations.json (1)

1-2334: LGTM: Complete Vietnamese translation file added

The Vietnamese translation file is comprehensive and well-structured, covering all UI elements and messages needed for a complete localization. The JSON structure matches the expected format for translation files in the application.

packages/i18n/src/locales/pt-BR/translations.json (1)

22-91: Authentication Section Quality Check
The translations in the "auth" section are comprehensive and clearly structured. All labels, placeholders, and error messages appear accurate and contextually appropriate. The nested structure (e.g. for password, confirmation, and toast messages) is logical.

@sriramveeraghanta sriramveeraghanta merged commit 2d1b3fb into preview Apr 1, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the feat-vietnamese-and-portuguese-language-support branch April 1, 2025 11:13
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.

5 participants