[WEB-3732 | WEB-3731] feat: Vietnamese and Portuguese language support#6854
Conversation
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.
WalkthroughThe 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
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
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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 (
|
|
Pull Request Linked with Plane Work Items
Comment Automatically Generated by Plane |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
packages/i18n/src/constants/language.ts (1)
20-20: LGTM: Added Portuguese and Vietnamese language supportThe 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
📒 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 languagesThe 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 languagesThe 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 addedThe 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.
Description
This PR includes following language support:
Type of Change
References
[WEB-3732 | WEB-3731]
Summary by CodeRabbit