Skip to content

[WEB-3798]chore: updated language support to estimates#6900

Merged
pushya22 merged 1 commit intopreviewfrom
chore-time_estimates_translation
Apr 9, 2025
Merged

[WEB-3798]chore: updated language support to estimates#6900
pushya22 merged 1 commit intopreviewfrom
chore-time_estimates_translation

Conversation

@vamsikrishnamathala
Copy link
Member

@vamsikrishnamathala vamsikrishnamathala commented Apr 9, 2025

Description

Updated translations for estimates.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

WEB-3798

Summary by CodeRabbit

  • New Features

    • Enhanced the estimation system with clearly labeled steps and intuitive instructions.
    • Expanded estimation options with structured categories (points, categories, and time) and improved localization across multiple languages.
  • UI Improvements

    • Updated modal texts and input placeholders to provide a more seamless experience.
    • Refined dropdown spacing for smoother interaction when search is disabled.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 9, 2025

Walkthrough

This 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

File(s) Change Summary
packages/i18n/src/locales/*/translations.json Added new keys under the estimates section (e.g., "new", "step", "label") and a "systems" object (with sub-objects for points, categories, and time); additional validation messages added for zh-CN.
packages/types/src/estimate.d.ts Simplified type declarations and added new properties (i18n_title in TTemplateValues, i18n_name in TEstimateSystem) to support localization.
packages/ui/src/dropdown/common/options.tsx Updated class name assignment to conditionally include margin styling via the cn helper function based on the disableSearch prop.
web/ce/constants/estimates.ts Introduced new i18n properties (i18n_name for system categories and i18n_title for templates) to enhance translation support.
web/core/components/estimates/create/modal.tsx Replaced static text with translatable strings using t(), including changes to modal title, step count, and button labels.
web/core/components/estimates/create/stage-one.tsx Replaced direct property references with calls to t() to retrieve the localized i18n_name from the ESTIMATE_SYSTEMS object.
web/core/components/estimates/inputs/text-input.tsx Updated the input placeholder key from enter_estimate_input to enter_estimate_point.

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
Loading

Possibly related PRs

Suggested labels

🌟improvement

Suggested reviewers

  • anmolsinghbhatia
  • prateekshourya29

Poem

I’m a little bunny with hop in my step,
Adding translations while I softly prep.
New keys and texts make the estimates gleam,
In every locale, like a dream.
With carrots and code, I cheer and play –
A hoppin’ delight in a world of array!
🥕🐰 Happy coding all day!

✨ 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 9, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

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: 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 Translations

The 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

📥 Commits

Reviewing files that changed from the base of the PR and between 993c789 and 67a66d5.

📒 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_name property instead of directly using the name property, 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_title property has been added to the TTemplateValues type, correctly supporting localization of template titles.


62-62: Added i18n_name for estimate system.

The i18n_name property has been added to the TEstimateSystem type, correctly supporting localization of estimate system names.


17-17: Type declaration simplification.

The type declarations for TEstimateSystemKeys and TEstimateTypeError have 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 implementation

You'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 parameters

Nice 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 consistency

Good use of the common translation key for the cancel button, promoting consistency across the application.


203-203: Proper handling of conditional text with translations

You'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 system

The translation for "New estimate system" in Chinese looks correct.


1750-1751: Added step indicator and create label translations

These translation keys match what's being used in the modal component, ensuring proper internationalization support.


1791-1799: Comprehensive validation messages added

Good 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 label

The translations look appropriate and match the parameters used in the code.


1799-1817: Complete estimation systems categorization added

Excellent 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" Section

The 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 Estimation

The 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" Section

The 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 Estimation

The 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 Structure

The 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.

@pushya22 pushya22 merged commit b738e39 into preview Apr 9, 2025
5 of 6 checks passed
@pushya22 pushya22 deleted the chore-time_estimates_translation branch April 9, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug Something isn't working 🧹chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants