[WEB-3689] feat: romanian and indonesian language support#6825
[WEB-3689] feat: romanian and indonesian language support#6825sriramveeraghanta merged 3 commits intopreviewfrom
Conversation
Co-authored-by: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com>
WalkthroughThis pull request extends the internationalization capabilities by adding Indonesian ("id") and Romanian ("ro") language support. It updates the language constants, incorporates new translation JSON files for both languages, adjusts the language import logic, and revises the TLanguage type accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant App as Application
participant TS as TranslationStore
participant Loader as Translation Loader
App->>TS: Request translation for selected language
TS->>TS: Check language code
alt Language is "id"
TS->>Loader: Import "../locales/id/translations.json"
else Language is "ro"
TS->>Loader: Import "../locales/ro/translations.json"
else
TS-->>App: Throw error (unsupported language)
end
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 (2)
packages/i18n/src/locales/id/translations.json (2)
1-20: Sidebar Translations Review
The "sidebar" block is neatly organized and covers a variety of navigation elements. One point to consider: while keys such as"projects","pages", and"new_work_item"are properly localized (e.g., "Projek", "Halaman", "Item kerja baru"), terms like"workspace","views", and"upgrade"remain in English. Please verify whether these should be translated (for example,"workspace"could be translated to"Ruang kerja") according to your localization guidelines.
1-2372: Overall File Structure and Localization Consistency
This new Indonesian translations file is comprehensive and follows a well-organized, nested JSON format covering a wide range of categories (e.g., "auth", "sidebar", "common", "project_settings", etc.). All dynamic placeholders (such as{seconds},{count}, and{length}) are correctly maintained. A couple of suggestions:
• Ensure consistency across the file regarding whether certain English terms (such as"workspace"or"views") should be localized, given that similar keys in other sections are sometimes translated.
• It would be beneficial to have a native Indonesian speaker review the idiomatic expressions and terminology to ensure cultural appropriateness.
Overall, the file meets the requirements for extending language support and appears to integrate correctly with your i18n infrastructure.
📜 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/id/translations.json(1 hunks)packages/i18n/src/locales/ro/translations.json(1 hunks)packages/i18n/src/store/index.ts(1 hunks)packages/i18n/src/types/language.ts(1 hunks)
🔇 Additional comments (5)
packages/i18n/src/constants/language.ts (1)
20-21: Excellent addition of new language options!The Indonesian and Romanian languages have been properly added to the
SUPPORTED_LANGUAGESarray with their respective display names and language codes. This aligns perfectly with the PR objective of adding support for these languages.packages/i18n/src/types/language.ts (1)
1-17: Good refactoring and language addition!The
TLanguagetype has been effectively refactored from a single-line to multi-line format, improving readability. The Indonesian ("id") and Romanian ("ro") language codes have been correctly added to the union type, which ensures type safety when using these new language codes throughout the application.packages/i18n/src/store/index.ts (1)
168-171: Great implementation of translation imports for the new languages!The new language cases for Indonesian and Romanian have been correctly added to the
importLanguageFilemethod, following the established pattern used for other languages. This ensures that the application can properly load translations for these languages when selected by the user.packages/i18n/src/locales/ro/translations.json (1)
1-2372: Comprehensive Romanian translations added successfully!The Romanian translation file is well-structured and includes translations for all the necessary UI elements, including sidebar navigation, authentication flows, project management terms, error messages, and more. The translations appear to be complete and follow the same JSON structure as other language files.
packages/i18n/src/locales/id/translations.json (1)
22-91: Authentication Translations Review
The nested "auth" section is well structured with clear subcategories for elements such as email, password, and error messages. The placeholders and error strings (e.g.,"Email wajib diisi","Email tidak valid", and"Password lemah") read naturally in Indonesian. It would be worthwhile to ensure that all placeholder values—for instance, in"resend_in": "Kirim ulang dalam {seconds} detik"—are consistent with how dynamic terms are injected elsewhere in the application.
* Add ro Romanian Language locale (#6809) * feat: add Indonesian language support (#6794) Co-authored-by: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> * chore: core translation added and code refactor --------- Co-authored-by: mnbro <107358316+mnbro@users.noreply.github.com> Co-authored-by: Rasyid Ridho <rasyid@sekeco.id>
Description
This PR adds language support for:
Type of Change
References
[WEB-3689]
Summary by CodeRabbit