[WEB-3798]chore: updated language support to estimates#6900
Conversation
WalkthroughThis pull request enhances the estimation system’s internationalization support by adding new translation keys and sections across multiple locale files. In addition, type definitions and UI component implementations have been updated to utilize these translations. The changes also include refining the styling in one dropdown component and expanding constants with new i18n properties for estimate systems. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Modal
participant TranslationService
participant LocaleFile
User->>Modal: Initiate estimate creation
Modal->>TranslationService: t("project_settings.estimates.new")
TranslationService->>LocaleFile: Lookup key "project_settings.estimates.new"
LocaleFile-->>TranslationService: Return localized string
TranslationService-->>Modal: Return localized text
Modal->>User: Render modal with translated content
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: 8
🧹 Nitpick comments (5)
packages/i18n/src/locales/pt-BR/translations.json (2)
1745-1754: New Keys for Estimation Creation Updated
New translation entries have been added within the"estimates"section. In particular, the key"new"with the value"Novo sistema de estimativa"is introduced, and within the nested"create"object the keys"enter_estimate_point","step", and"label"(with values"Inserir estimativa","Passo {step} de {total}", and"Criar estimativa", respectively) have been added to support the updated estimation flow. Please verify that the placeholder syntax (e.g.{step}and{total}) is consistent with the application’s runtime formatting.
1801-1820: New 'systems' Object for Estimation Methods
A new"systems"block has been inserted under the"estimates"object to provide translations for multiple estimation methods. This includes nested keys for"points","categories", and"time", each with their corresponding labels (e.g."Pontos","Categorias", and"Tempo") and specific system types such as"Fibonacci","Linear","Quadrados", and"Personalizado". The translations appear clear and consistent with similar locale updates. Please double-check that these keys match the expected identifiers in the codebase.packages/i18n/src/locales/it/translations.json (1)
1742-1750: Estimation Translation Keys Added (Italian)
New translation keys under the "estimates" section have been added to support the new estimation system. In particular, the keys"new","enter_estimate_point","step", and"label"(within the"create"object) are introduced. Please verify that:
- The placeholder variables (
{step}and{total}) are used consistently and correctly.- The chosen wording in Italian (e.g.
"Nuovo sistema di stima","Inserisci stima","Passo {step} di {total}", and"Crea stima") accurately conveys the intended functionality and tone.
It is also recommended to compare these updates with translations in other locales (such as Czech, German, and English) to maintain consistency across your application’s internationalization.packages/i18n/src/locales/vi-VN/translations.json (1)
1718-1726: Estimation Translation Keys Added (Vietnamese)
The new keys for the estimation system have been introduced in the Vietnamese locale. These include:
"new": "Hệ thống ước tính mới"- Within the
"create"object:"enter_estimate_point","step", and"label"with their respective translations.
Please ensure that the placeholders ({step}and{total}) are correctly maintained and that the translations effectively communicate the intended meaning. As with other locales, a cross-check for consistency with the new estimation feature across the application is recommended.packages/i18n/src/locales/ja/translations.json (1)
1749-1751: Review of New Estimate Creation TranslationsThe new keys within the
"create"block for estimates—namely"enter_estimate_point": "見積もりを入力","step": "ステップ {step} の {total}", and"label": "見積もりを作成"—have been added to support the updated language support for estimates. Please double-check that these translations:
- Align with the product’s established terminology.
- Use placeholders consistently with other locale files.
- Convey natural phrasing for your target users (for example, consider if
"ステップ {step} の {total}"might read more clearly as"ステップ {step}/{total}").If these points are verified with your style guidelines, the changes look good.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (24)
packages/i18n/src/locales/cs/translations.json(2 hunks)packages/i18n/src/locales/de/translations.json(2 hunks)packages/i18n/src/locales/en/translations.json(2 hunks)packages/i18n/src/locales/es/translations.json(2 hunks)packages/i18n/src/locales/fr/translations.json(2 hunks)packages/i18n/src/locales/id/translations.json(2 hunks)packages/i18n/src/locales/it/translations.json(2 hunks)packages/i18n/src/locales/ja/translations.json(2 hunks)packages/i18n/src/locales/ko/translations.json(2 hunks)packages/i18n/src/locales/pl/translations.json(2 hunks)packages/i18n/src/locales/pt-BR/translations.json(2 hunks)packages/i18n/src/locales/ro/translations.json(2 hunks)packages/i18n/src/locales/ru/translations.json(2 hunks)packages/i18n/src/locales/sk/translations.json(2 hunks)packages/i18n/src/locales/ua/translations.json(2 hunks)packages/i18n/src/locales/vi-VN/translations.json(2 hunks)packages/i18n/src/locales/zh-CN/translations.json(2 hunks)packages/i18n/src/locales/zh-TW/translations.json(2 hunks)packages/types/src/estimate.d.ts(3 hunks)packages/ui/src/dropdown/common/options.tsx(1 hunks)web/ce/constants/estimates.ts(8 hunks)web/core/components/estimates/create/modal.tsx(2 hunks)web/core/components/estimates/create/stage-one.tsx(1 hunks)web/core/components/estimates/inputs/text-input.tsx(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
web/core/components/estimates/inputs/text-input.tsx (1)
packages/i18n/src/store/index.ts (1)
t(231-252)
web/core/components/estimates/create/modal.tsx (1)
packages/i18n/src/store/index.ts (1)
t(231-252)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (javascript)
- GitHub Check: Analyze (python)
🔇 Additional comments (35)
web/core/components/estimates/inputs/text-input.tsx (1)
19-19: Translation key updated correctly.The placeholder text now uses the translation key
"enter_estimate_point"instead of"enter_estimate_input", which better aligns with the internationalization efforts for the estimation system.packages/ui/src/dropdown/common/options.tsx (1)
45-45: Improved conditional styling.The margin-top styling is now conditionally applied only when search is enabled, resulting in better visual consistency across different dropdown states.
web/core/components/estimates/create/stage-one.tsx (2)
41-42: Internationalization properly implemented for estimate system names.The code now uses the translation function with the
i18n_nameproperty instead of directly using thenameproperty, ensuring proper localization of estimate system names.Also applies to: 48-49, 52-53
80-82: TODO comment needs addressing.There's still a TODO comment indicating that translation is needed for this text string.
Consider replacing the hardcoded text with a translation key, similar to how you've implemented translations for other parts of the component:
- {/* TODO: Translate here */} - Add your own <span className="lowercase">{currentEstimateSystem.name}</span> from scratch + {t("project_settings.estimates.create.add_your_own", { estimateSystem: t(currentEstimateSystem.i18n_name).toLowerCase() })}Make sure the corresponding translation keys exist in your translation files.
packages/types/src/estimate.d.ts (3)
55-55: Added i18n_title for template values.The
i18n_titleproperty has been added to theTTemplateValuestype, correctly supporting localization of template titles.
62-62: Added i18n_name for estimate system.The
i18n_nameproperty has been added to theTEstimateSystemtype, correctly supporting localization of estimate system names.
17-17: Type declaration simplification.The type declarations for
TEstimateSystemKeysandTEstimateTypeErrorhave been simplified to a single line format, maintaining functionality while improving code readability.Also applies to: 84-84
web/core/components/estimates/create/modal.tsx (4)
156-156: Good internationalization implementationYou've properly replaced the hardcoded string "New estimate system" with a translatable string using the
t()function, which will support multiple languages.
159-162: Well-structured translation with parametersNice implementation of the step counter text using parameters in the translation function. This approach makes it easy to adapt the sentence structure for different languages.
199-199: Using common translation key for consistencyGood use of the common translation key for the cancel button, promoting consistency across the application.
203-203: Proper handling of conditional text with translationsYou've correctly implemented the conditional text with appropriate translation keys, maintaining the same logic while making the text translatable.
packages/i18n/src/locales/zh-CN/translations.json (3)
1743-1743: Added key for new estimate systemThe translation for "New estimate system" in Chinese looks correct.
1750-1751: Added step indicator and create label translationsThese translation keys match what's being used in the modal component, ensuring proper internationalization support.
1791-1799: Comprehensive validation messages addedGood addition of detailed validation messages for the estimate system. These will help Chinese users understand errors and requirements clearly.
packages/i18n/src/locales/cs/translations.json (2)
1748-1749: Added Czech translations for estimate step and labelThe translations look appropriate and match the parameters used in the code.
1799-1817: Complete estimation systems categorization addedExcellent work adding a comprehensive set of translations for different estimation methods. The structured organization of points, categories, and time estimation systems will support a robust localized user experience.
packages/i18n/src/locales/fr/translations.json (2)
1743-1752: Estimate Creation Keys Added (French Locale)
The new keys under the"estimates"section—specifically"new": "Nouveau système d'estimation"and the keys within the"create"sub-object ("enter_estimate_point": "Saisir une estimation","step": "Étape {step} de {total}", and"label": "Créer une estimation") have been added correctly. The placeholder syntax ({step}and{total}) appears consistent. Please double-check that these keys match the naming and formatting conventions used in other locale files so that functionality remains uniform across languages.
1801-1819: Estimation Systems Structure Defined (French Locale)
The addition of the"systems"object—divided into"points","categories", and"time"sub-objects with their associated translation keys (e.g."label": "Points","fibonacci": "Fibonacci","linear": "Linéaire","squares": "Carrés","custom": "Personnalisé", etc.)—is clear and well-organized. This structure should ensure that users can easily navigate the different estimation methods. Consider verifying that the punctuation and overall format align with the project’s established style.packages/i18n/src/locales/de/translations.json (2)
1717-1725: New Estimation Creation Keys Added (German Locale)
Within the"estimates"section, the new key"new": "Neues Schätzungssystem"along with the keys in the"create"sub-object ("enter_estimate_point": "Schätzung eingeben","step": "Schritt {step} von {total}", and"label": "Schätzung erstellen") have been introduced appropriately. The localized text and placeholder formatting look correct. Please ensure consistency with the corresponding keys in other locale files.
1776-1792: Estimation Systems Structure Defined (German Locale)
The newly added"systems"object with its subdivisions for"points","categories", and"time"is structured similarly to other translations. The keys such as"label": "Punkte","fibonacci": "Fibonacci","linear": "Linear","squares": "Quadrate","custom": "Benutzerdefiniert", as well as those for"categories"and"time", accurately translate and mirror the corresponding French and English versions. This ensures a consistent user experience across locales.packages/i18n/src/locales/pl/translations.json (1)
1720-1728: New Estimates Translation Keys Added (Polish Locale)
The newly introduced keys within the"estimates"block—namely"new","enter_estimate_point","step", and"label"—appear to be well integrated and consistent. Please double-check that these placeholders (e.g.{step}and{total}in"step") work as expected in the UI and that their wording aligns with similar translations in other locales.packages/i18n/src/locales/ua/translations.json (1)
1720-1728: New Estimates Translation Keys Added (Ukrainian Locale)
The new keys for the estimation system—"new": "Нова система оцінок","enter_estimate_point": "Введіть оцінку","step": "Крок {step} з {total}", and"label": "Створити оцінку"—are clear and consistent with the overall tone of the file. Please verify that the placeholders are rendered correctly in the application and that the phrasing remains consistent with other locale files.packages/i18n/src/locales/ro/translations.json (3)
1743-1743: Proper internationalization support for new estimate system.The addition of "new" translation key for Romanian locale properly supports the new estimation system feature in the UI.
1750-1753: Added necessary step indicator and creation labels for estimates.These new keys properly support the multi-step workflow for estimates creation, with the step indicator showing progress and the appropriate action label.
1801-1819: Complete internationalization for estimation systems.Good addition of comprehensive translations for all estimation system types and their options. The structure properly mirrors the estimation systems defined in the constants file, covering points, categories, and time-based estimates with all their variations.
packages/i18n/src/locales/zh-TW/translations.json (3)
1745-1745: Proper translation for new estimate system in Traditional Chinese.The addition of "new" translation key for Traditional Chinese locale properly supports the new estimation system feature in the UI.
1751-1753: Added workflow step indicators and creation labels for Traditional Chinese.These new keys properly support the multi-step workflow for estimates creation in Traditional Chinese, maintaining consistency with other locales.
1803-1820: Comprehensive translations for estimation systems in Traditional Chinese.Complete set of translations for all estimation system types and their options in Traditional Chinese. The structure correctly mirrors the estimation systems defined in the constants file.
web/ce/constants/estimates.ts (2)
26-26: Added i18n support for estimation system categories.Good addition of internationalization properties for the main estimation categories (points, categories, time), which will enable proper localization of these terms across the application.
Also applies to: 79-79, 118-118
30-30: Added i18n support for estimation templates.Properly added internationalization properties for each estimation template, ensuring all user-facing strings can be translated. The keys follow a consistent pattern and match the structure defined in the translation files.
Also applies to: 42-42, 54-54, 66-66, 83-83, 95-95, 105-105, 122-122
packages/i18n/src/locales/ko/translations.json (2)
1745-1754: New Estimation Translation Keys Added in the Estimates "create" SectionThe new keys for the estimation feature—specifically
"new": "새 추정 시스템","enter_estimate_point": "추정 입력","step": "단계 {step}/{total}", and"label": "추정 생성"—are clearly introduced. The use of placeholders (e.g.{step}and{total}) appears correct and consistent with similar keys in other locale files. Please double-check that all UI components referencing these keys have been updated accordingly.
1802-1821: Addition of the “systems” Sub-Section for EstimationThe newly added
"systems"object—which groups estimation methods into three sub-objects ("points","categories", and"time")—is well structured. The translations inside, such as"fibonacci": "피보나치","linear": "선형","squares": "제곱", and"custom": "사용자 정의", as well as similar keys under"categories"and"time", are clear and consistent. This enhances international support for the estimation feature.packages/i18n/src/locales/id/translations.json (2)
1743-1753: New Estimation Translation Keys in the Estimates "create" SectionThe Indonesian locale now includes the updated estimation keys with
"new": "Sistem perkiraan baru","enter_estimate_point": "Masukkan perkiraan","step": "Langkah {step} dari {total}", and"label": "Buat perkiraan". The placeholder formatting for{step}and{total}is handled correctly with localized phrasing. Ensure that these keys align with the corresponding updates in other languages for a consistent experience.
1798-1820: Addition of the “systems” Object for EstimationThe new
"systems"object in the Indonesian translations—with its sub-objects for"points","categories", and"time"—mirrors the updates made in other locales. The provided translations, for example,"fibonacci": "Fibonacci","linear": "Linear","squares": "Kuadrat","custom": "Kustom"under"points", and the corresponding keys under"categories"and"time", are clear and consistent. This update significantly improves the localization coverage for the estimation features.packages/i18n/src/locales/ja/translations.json (1)
1801-1819: Review of the New Estimates Systems StructureThe newly introduced
"systems"block under estimates—with nested objects for"points","categories", and"time"—is well structured and enhances the clarity of the estimation process. The translations (e.g.,"ポイント","フィボナッチ","リニア","二乗","カスタム"under"points"; and similarly for"categories"and"time") appear accurate. Please verify that these terms are consistent with those in other locale files and that they effectively communicate the various estimation methods to Japanese-speaking users.
Description
Updated translations for estimates.
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
WEB-3798
Summary by CodeRabbit
New Features
UI Improvements