Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-3165]feat: language support for issues #6452

Draft
wants to merge 6 commits into
base: preview
Choose a base branch
from

Conversation

mathalav55
Copy link
Collaborator

@mathalav55 mathalav55 commented Jan 24, 2025

Description

This update includes refactoring and translations for issue constants.

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-3165

Summary by CodeRabbit

Based on the comprehensive summary of changes, here are the high-level release notes:

Release Notes

🌐 Internationalization Improvements

  • Enhanced localization support across the application
  • Added translation capabilities for issue-related components
  • Introduced dynamic translation of titles, labels, and messages
  • Improved multi-language user experience

📊 Issue Management Updates

  • Restructured issue constants and types
  • Updated layout and filter management
  • Centralized constants in @plane/constants module
  • Improved issue display and filtering mechanisms

🔧 Technical Enhancements

  • Consolidated import statements
  • Refactored constants and utility functions
  • Updated gradient and icon rendering
  • Improved type safety and code organization

🌈 Key Changes

  • New translation support across UI components
  • Centralized constants management
  • Improved internationalization infrastructure
  • Enhanced issue layout and filtering capabilities

* chore: restructured issue constants
* improvement: added translations to issue constants
* chore: updated translation for issues mobile header
@mathalav55 mathalav55 added 🌟enhancement New feature or request 🌐frontend labels Jan 24, 2025
@mathalav55 mathalav55 self-assigned this Jan 24, 2025
Copy link
Contributor

coderabbitai bot commented Jan 24, 2025

Walkthrough

This pull request involves a comprehensive refactoring of issue-related constants, types, and localization across multiple files in the Plane project. The primary changes include:

  1. Removing the existing issue.ts constants file
  2. Creating new modular constant files in packages/constants/src/issue/
  3. Implementing internationalization (i18n) support across various components
  4. Updating import statements to use centralized constants from @plane/constants
  5. Replacing hardcoded strings with translation keys

Changes

File/Group Change Summary
packages/constants/src/issue/ New modular structure for issue-related constants with separate files for common, filter, and layout definitions
Localization Files Updated translation JSON files for multiple languages with new hierarchical structure
Components Integrated useTranslation hook for dynamic text rendering
Import Statements Consolidated imports from @plane/constants instead of local constant files

Poem

🐰 A Rabbit's Refactoring Rhyme 🐰

Constants dancing, types so bright,
Internationalization taking flight!
From hardcoded strings to translation's grace,
Our code now speaks in every place.
Hop, hop, hurray for cleaner design! 🌈

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

@mathalav55 mathalav55 marked this pull request as draft January 24, 2025 08:01
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: 6

🧹 Nitpick comments (40)
web/core/components/project/project-feature-update.tsx (1)

38-38: Consider consolidating the entire phrase into a single translation key for better localization.

Currently, multiple calls to t() are pieced together to form a sentence. This can be challenging for translators, especially if the word order or grammatical rules differ across languages. It’s usually better to have the entire sentence, including punctuation, in a single translation key. You can also handle capitalization (like created.toLowerCase()) in the translation file itself to avoid locale-specific edge cases.

Here's a possible refactor in diff form (assuming your translation files can handle placeholders for React fragments):

-          {t("congrats")}! {t("project.label", { count: 1 })} <Logo logo={currentProjectDetails.logo_props} />{" "}
-          <p className="break-all">{currentProjectDetails.name}</p> {t("created").toLowerCase()}.
+          {t("projectCreationMessage", {
+            projectLogo: <Logo logo={currentProjectDetails.logo_props} />,
+            projectName: currentProjectDetails.name,
+          })}

Then in your translation file (e.g., en.json):

{
  "projectCreationMessage": "{{projectLogo}} {{projectName}} was created successfully!"
}
web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(detail)/[viewId]/header.tsx (1)

244-244: Consider adding a default or fallback for invalid layouts.

Right now, if activeLayout is unrecognized, this line sets layoutDisplayFiltersOptions to undefined. If you expect different behavior or a default set of filters, consider adding a fallback.

- activeLayout ? ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout] : undefined
+ activeLayout && ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout]
+   ? ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout]
+   : ISSUE_DISPLAY_FILTERS_BY_PAGE.issues['LIST'] // or any default
web/core/components/issues/issue-layouts/layout-icon.tsx (1)

1-2: Evaluate imports for potential bundle size impact

You're importing multiple icons from lucide-react in a single statement. Consider whether tree-shaking is fully supported or if more granular imports of only the icons used might reduce bundle size.

web/core/components/issues/issue-layouts/filters/header/display-filters/order-by.tsx (1)

18-19: Using hooks section clarifies code structure

Adding the “hooks” comment and introducing useTranslation clearly delineate the component’s functional sections. This improves readability and makes i18n usage more discoverable.

web/core/components/issues/issue-layouts/filters/header/display-filters/extra-options.tsx (1)

34-35: Descriptive hook comment
The comment // hooks provides little additional context. Consider removing or expanding the comment to describe the purpose of this specific hook usage.

- // hooks
+ // retrieves translation method from the i18n framework
web/core/components/issues/issue-layouts/filters/header/display-filters/issue-grouping.tsx (1)

51-51: Combined translation keys
Appending issueType.i18n_title with the epic/issue label could introduce spacing or localization nuances for certain languages. Monitor translations to ensure readability.

packages/constants/src/issue/layout.ts (2)

25-43: Remove or reintroduce commented-out layout objects.
Leaving multiple entries commented out can create confusion. Consider either removing them if they’re obsolete or reintroducing them if you plan to support these layouts soon.


73-76: Use array if specific order is required.
Object.values(...) does not guarantee a stable order across all JS engines for enumerated properties. If a strict layout order matters, explicitly define it in an array.

web/core/components/inbox/inbox-filter/filters/priority.tsx (1)

37-37: Dynamic label shows user-friendly context.
Appending the applied filter count to the translation is a clear way to communicate how many filters are active.

space/core/components/issues/navbar/layout-selection.tsx (1)

52-52: Fallback strategy for missing translation keys
Consider adding a fallback string if layout.titleTranslationKey is blank or undefined. This helps avoid display issues in locales lacking a translation key.

<Tooltip key={layout.key} tooltipContent={
-  t(layout.titleTranslationKey)
+  layout.titleTranslationKey ? t(layout.titleTranslationKey) : 'Layout'
}>
web/core/components/issues/issue-layouts/group-drag-overlay.tsx (1)

75-75: Translation key usage for order label
Using issue.layouts.ordered_by_label is a great improvement for localization. Just ensure this key (and every localized version) is present in your translation files.

web/core/components/issues/issue-layouts/filters/header/display-filters/display-properties.tsx (1)

86-86: Fallback for missing translation key.

If displayProperty.titleTranslationKey is undefined, the UI could break. Consider adding a default to remain resilient.

- {t(displayProperty.titleTranslationKey)}
+ {t(displayProperty.titleTranslationKey || "issue.display.properties.defaultTitle")}
web/core/components/profile/profile-issues-filter.tsx (3)

113-113: Add a fallback or validation for layout display filters.
ISSUE_DISPLAY_FILTERS_BY_PAGE.profile_issues[activeLayout] could be undefined if activeLayout isn’t a valid key. Consider a default fallback to prevent potential runtime errors.

- activeLayout ? ISSUE_DISPLAY_FILTERS_BY_PAGE.profile_issues[activeLayout] : undefined
+ activeLayout && ISSUE_DISPLAY_FILTERS_BY_PAGE.profile_issues[activeLayout]
+   ? ISSUE_DISPLAY_FILTERS_BY_PAGE.profile_issues[activeLayout]
+   : ISSUE_DISPLAY_FILTERS_BY_PAGE.profile_issues["LIST"] // or another sensible default

125-125: Confirm translation key availability.
Similarly, you replaced "Display" with t("common.display"). Verify the existence of that key in translation files.


128-128: Ensure defensive handling for invalid activeLayout.
Once again, add a fallback in case profile_issues[activeLayout] is undefined to avoid empty filter options.

web/app/[workspaceSlug]/(projects)/workspace-views/header.tsx (1)

131-131: Apply the same fallback or validation approach.
Again, consider a fallback if my_issues.spreadsheet is undefined. Where possible, unify fallback logic across your components for consistency.

space/core/components/issues/issue-layouts/utils.tsx (1)

132-133: Check for translation fallbacks.

Using i18n_name: priority.titleTranslationKey ensures all UI references come from translation keys. However, consider providing a default or fallback for scenarios where the translation string might be missing.

packages/constants/src/issue/common.ts (2)

7-8: Introduce ALL_ISSUES constant.

Defining ALL_ISSUES = "All Issues" is clear and descriptive. If localization is required here, consider using a translation key.


32-43: EIssueGroupBYServerToProperty enum.

Avoid confusion with "BY" vs. "By" in naming, but otherwise the mapping is consistent.

web/app/[workspaceSlug]/(projects)/profile/[userId]/mobile-header.tsx (1)

149-153: Repeated translation for "filters"
You’re displaying translations for “filters” in both the title prop and the button text. Consider extracting a small helper or ensuring they always stay in sync if a future change occurs.

web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/mobile-header.tsx (1)

131-132: Icon and text usage for layout selection.
Using IssueLayoutIcon with mapped ISSUE_LAYOUTS[index].key is consistent. Just verify that the keys in layouts vs. ISSUE_LAYOUTS remain in sync.

web/helpers/issue.helper.ts (1)

106-106: Consider adding a safe fallback when reading from ISSUE_DISPLAY_FILTERS_BY_PAGE.
Using layoutOptions = ISSUE_DISPLAY_FILTERS_BY_PAGE[viewType][layout] is good, but if either viewType or layout is missing or invalid, it may raise an error. Consider adding checks or a default.

+ const layoutOptions = ISSUE_DISPLAY_FILTERS_BY_PAGE[viewType]?.[layout] || { filters: [], display_filters: {}, extra_options: { access: false, values: [] } };
web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx (1)

248-248: Consider handling edge cases for unknown layout keys.
Using activeLayout ? ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout] : undefined might cause issues if activeLayout doesn't exist as a key. Provide a clearer fallback to avoid undefined behavior.

- activeLayout ? ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout] : undefined
+ activeLayout && ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout]
+   ? ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout]
+   : {}
web/core/components/issues/issue-layouts/list/list-group.tsx (1)

214-217: Unify user feedback for blocked drag-and-drop.
We use t("common.warning") in the title for the toast. Consider standardizing the error/warning keys to simplify translation handling, and ensure consistent user feedback.

- title: t("common.warning"),
+ title: t("error.drag_not_allowed"),
web/core/components/issues/issue-layouts/kanban/kanban-group.tsx (1)

88-89: Validate translation usage.

The instantiation of useTranslation is correct. Consider implementing a fallback or default language strategy to handle potential missing translation keys.

web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/header.tsx (1)

75-76: Verify translator hook usage.

Appropriately introduces the t function for localized strings. Good practice to keep translations in the same scope to ensure clarity.

web/core/store/issue/helpers/issue-filter-helper.store.ts (1)

9-9: Conditional Gantt expansion.

Importing ENABLE_ISSUE_DEPENDENCIES and leveraging it to expand Gantt-specific relations is straightforward. Confirm that toggling this constant off does not break other layouts or cause unexpected side effects in the store logic.

web/core/components/views/form.tsx (2)

208-208: Localized placeholder for title.

Using t("common.title") for the placeholder is beneficial for multi-language environments. Expand the logic to other placeholders in the form.


342-348: Multi-state submit button text.

Dynamically rendering text for different submission states with translation keys ("updating", "creating", etc.) ensures clarity for end-users. Confirm all states, including error states, are handled thoroughly.

packages/constants/src/issue/filter.ts (2)

96-483: Consider extracting common filter definitions into reusable structures.

Many of the filter arrays in ISSUE_DISPLAY_FILTERS_BY_PAGE are repeated or differ only slightly across different page types and layouts. This makes the file verbose and can introduce potential maintenance overhead if any updates are required across multiple entries. Consider refactoring these into composable or reusable utilities to reduce duplication and improve consistency.


530-530: Confirm the purpose of ENABLE_ISSUE_DEPENDENCIES.

This flag is currently set to false, but there’s no usage or follow-up code in this file. If you plan to switch this functionality on in the future, consider adding documentation (comment) or references clarifying how it’s toggled, what it implies, and where it’s used.

web/core/components/dropdowns/priority.tsx (3)

123-127: Unify tooltip content and text label for priority.

Currently, the tooltip content uses priorityDetails?.key ?? "none" while the text label uses priorityDetails?.titleTranslationKey ?? "common.priority". If both should display the same localized text, consider using titleTranslationKey consistently or providing separate, clearly distinct translations for each context if required.


210-214: Ensure consistent translation usage in BackgroundButton.

Similar to the BorderButton component, the tooltip content uses t(priorityDetails?.key ?? "none") whereas the displayed text uses t(priorityDetails?.titleTranslationKey ?? "common.priority"). Clarify whether both should be aligned, possibly using only the translation key to maintain a consistent user experience.


254-254: Use a more descriptive fallback or unify fallback logic.

When titleTranslationKey is not found, defaulting to "none" might be confusing if the user expects a standard fallback like "common.priority". Consider standardizing the fallback text across all variants.

space/core/components/issues/issue-layouts/properties/priority.tsx (1)

17-18: Best practice: Provide fallback for priority_detail keys.

While the fallback is handled later, consider verifying each property (e.g., priority_detail?.titleTranslationKey) earlier to help reduce potential empty translations or strings. This clarifies error handling if the priority is ever null or an unsupported type.

space/core/components/issues/issue-layouts/list/list-group.tsx (1)

112-112: Consider adding a type guard for i18n_name.

The fallback logic is good, but consider adding a type guard to ensure i18n_name is a string.

-title={group.i18n_name ? t(group.i18n_name) : group.name}
+title={typeof group.i18n_name === 'string' ? t(group.i18n_name) : group.name}

Also applies to: 112-112

packages/i18n/src/locales/fr/translations.json (2)

377-380: Consider adding more context parameters for entity messages.

The entity messages use basic parameterization, but could benefit from additional context parameters for better localization.

Example enhancement:

-    "grouping_title": "Groupement de {entity}",
+    "grouping_title": "Groupement de {entity, select, issue {problème} epic {épopée} other {#}}",

424-427: Consider expanding issue states.

The issue states section seems minimal. Consider adding translations for other common states like "in_progress", "completed", "cancelled", etc.

Example addition:

   "states": {
     "active": "Actif",
-    "backlog": "Backlog"
+    "backlog": "Backlog",
+    "in_progress": "En cours",
+    "completed": "Terminé",
+    "cancelled": "Annulé"
   },
packages/i18n/src/locales/ja/translations.json (2)

408-422: Consider refining some Japanese layout terms for better natural flow.

The layout terminology could be more natural in Japanese:

  • "このレイアウトは" (This layout is) could be simplified to "並び順:" (Sort order:)
  • "ボード" is used for "Board" which is good, but consider adding the common suffix "ビュー" for consistency
  "layouts": {
-   "ordered_by_label": "このレイアウトは",
+   "ordered_by_label": "並び順:",
    "list": "リスト",
-   "kanban": "ボード",
+   "kanban": "ボードビュー",
    "calendar": "カレンダー",
    "spreadsheet": "表",
    "gantt": "ガントチャート",
    "title": {
      "list": "リストレイアウト",
      "kanban": "ボードレイアウト",
      "calendar": "カレンダーレイアウト",
      "spreadsheet": "テーブルレイアウト",
      "gantt": "タイムラインレイアウト"
    }
  }

395-407: Consider keeping some technical terms in English (カタカナ).

For better alignment with common Japanese software interfaces, consider using カタカナ for technical terms:

    "display": {
      "properties": {
        "label": "表示プロパティ",
-       "issue_type": "課題タイプ",
+       "issue_type": "イシュータイプ",
-       "sub_issue_count": "サブ課題数",
+       "sub_issue_count": "サブイシュー数",
        "attachment_count": "添付ファイル数"
      },
      "extra": {
-       "show_sub_issues": "サブ課題を表示",
+       "show_sub_issues": "サブイシューを表示",
        "show_empty_groups": "空のグループを表示"
      }
    }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0b53912 and d7309ed.

📒 Files selected for processing (73)
  • packages/constants/src/issue.ts (0 hunks)
  • packages/constants/src/issue/common.ts (1 hunks)
  • packages/constants/src/issue/filter.ts (1 hunks)
  • packages/constants/src/issue/index.ts (1 hunks)
  • packages/constants/src/issue/layout.ts (1 hunks)
  • packages/i18n/src/locales/en/translations.json (1 hunks)
  • packages/i18n/src/locales/es/translations.json (1 hunks)
  • packages/i18n/src/locales/fr/translations.json (1 hunks)
  • packages/i18n/src/locales/ja/translations.json (1 hunks)
  • packages/i18n/src/locales/zh-CN/translations.json (1 hunks)
  • packages/types/src/issues.d.ts (2 hunks)
  • space/core/components/issues/filters/priority.tsx (3 hunks)
  • space/core/components/issues/issue-layouts/kanban/default.tsx (3 hunks)
  • space/core/components/issues/issue-layouts/kanban/swimlanes.tsx (4 hunks)
  • space/core/components/issues/issue-layouts/list/list-group.tsx (4 hunks)
  • space/core/components/issues/issue-layouts/properties/priority.tsx (2 hunks)
  • space/core/components/issues/issue-layouts/utils.tsx (1 hunks)
  • space/core/components/issues/navbar/layout-selection.tsx (3 hunks)
  • space/core/components/issues/peek-overview/issue-properties.tsx (3 hunks)
  • web/app/[workspaceSlug]/(projects)/profile/[userId]/mobile-header.tsx (4 hunks)
  • web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/header.tsx (7 hunks)
  • web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/mobile-header.tsx (6 hunks)
  • web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/draft-issues/header.tsx (4 hunks)
  • web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/mobile-header.tsx (6 hunks)
  • web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx (3 hunks)
  • web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/mobile-header.tsx (5 hunks)
  • web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(detail)/[viewId]/header.tsx (3 hunks)
  • web/app/[workspaceSlug]/(projects)/workspace-views/header.tsx (3 hunks)
  • web/ce/components/issues/worklog/activity/filter-root.tsx (2 hunks)
  • web/ce/constants/index.ts (0 hunks)
  • web/ce/constants/issues.ts (0 hunks)
  • web/ce/store/issue/issue-details/activity.store.ts (1 hunks)
  • web/core/components/command-palette/actions/issue-actions/change-priority.tsx (3 hunks)
  • web/core/components/dropdowns/layout.tsx (4 hunks)
  • web/core/components/dropdowns/priority.tsx (8 hunks)
  • web/core/components/graphs/issues-by-priority.tsx (2 hunks)
  • web/core/components/inbox/inbox-filter/applied-filters/priority.tsx (2 hunks)
  • web/core/components/inbox/inbox-filter/filters/priority.tsx (4 hunks)
  • web/core/components/issues/archived-issues-header.tsx (3 hunks)
  • web/core/components/issues/filters.tsx (5 hunks)
  • web/core/components/issues/issue-detail/issue-activity/activity-comment-root.tsx (1 hunks)
  • web/core/components/issues/issue-detail/issue-activity/activity-filter.tsx (4 hunks)
  • web/core/components/issues/issue-detail/issue-activity/root.tsx (7 hunks)
  • web/core/components/issues/issue-layouts/filters/header/display-filters/display-properties.tsx (4 hunks)
  • web/core/components/issues/issue-layouts/filters/header/display-filters/extra-options.tsx (3 hunks)
  • web/core/components/issues/issue-layouts/filters/header/display-filters/group-by.tsx (4 hunks)
  • web/core/components/issues/issue-layouts/filters/header/display-filters/issue-grouping.tsx (3 hunks)
  • web/core/components/issues/issue-layouts/filters/header/display-filters/order-by.tsx (4 hunks)
  • web/core/components/issues/issue-layouts/filters/header/display-filters/sub-group-by.tsx (3 hunks)
  • web/core/components/issues/issue-layouts/filters/header/filters/filters-selection.tsx (4 hunks)
  • web/core/components/issues/issue-layouts/filters/header/filters/priority.tsx (3 hunks)
  • web/core/components/issues/issue-layouts/filters/header/layout-selection.tsx (3 hunks)
  • web/core/components/issues/issue-layouts/group-drag-overlay.tsx (3 hunks)
  • web/core/components/issues/issue-layouts/index.ts (1 hunks)
  • web/core/components/issues/issue-layouts/kanban/default.tsx (3 hunks)
  • web/core/components/issues/issue-layouts/kanban/kanban-group.tsx (4 hunks)
  • web/core/components/issues/issue-layouts/kanban/swimlanes.tsx (4 hunks)
  • web/core/components/issues/issue-layouts/layout-icon.tsx (1 hunks)
  • web/core/components/issues/issue-layouts/list/list-group.tsx (5 hunks)
  • web/core/components/issues/issue-layouts/roots/all-issue-layout-root.tsx (2 hunks)
  • web/core/components/issues/issue-layouts/utils.tsx (6 hunks)
  • web/core/components/profile/profile-issues-filter.tsx (3 hunks)
  • web/core/components/project/project-feature-update.tsx (1 hunks)
  • web/core/components/views/form.tsx (10 hunks)
  • web/core/components/workspace/views/form.tsx (9 hunks)
  • web/core/constants/dashboard.ts (5 hunks)
  • web/core/constants/issue.ts (0 hunks)
  • web/core/store/base-command-palette.store.ts (1 hunks)
  • web/core/store/issue/helpers/base-issues.store.ts (1 hunks)
  • web/core/store/issue/helpers/issue-filter-helper.store.ts (1 hunks)
  • web/core/store/issue/issue_kanban_view.store.ts (1 hunks)
  • web/ee/constants/issues.ts (0 hunks)
  • web/helpers/issue.helper.ts (2 hunks)
💤 Files with no reviewable changes (5)
  • web/ee/constants/issues.ts
  • web/ce/constants/index.ts
  • web/ce/constants/issues.ts
  • web/core/constants/issue.ts
  • packages/constants/src/issue.ts
✅ Files skipped from review due to trivial changes (3)
  • web/core/store/issue/issue_kanban_view.store.ts
  • packages/constants/src/issue/index.ts
  • web/core/store/issue/helpers/base-issues.store.ts
🔇 Additional comments (262)
web/ce/store/issue/issue-details/activity.store.ts (1)

11-11: Good job centralizing constants.

This import from @plane/constants helps avoid duplication and simplifies long-term maintenance of shared enums.

web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(detail)/[viewId]/header.tsx (2)

257-257: Duplicate logic for layoutDisplayFiltersOptions.

This code repeats the same pattern as line 244. For maintainability, consider abstracting this logic into a utility function to avoid duplication and keep the fallback behavior consistent.


9-9: Good consistency in adopting ISSUE_DISPLAY_FILTERS_BY_PAGE.

This import looks properly aligned with the new naming scheme. However, please verify if any usage of ISSUE_DISPLAY_FILTERS_BY_LAYOUT still lingers in the codebase to ensure total consistency.

Below is a script you can run to detect any residual references:

✅ Verification successful

Constant usage is correctly aligned with the codebase structure

The ISSUE_DISPLAY_FILTERS_BY_PAGE constant is consistently used throughout the web application, while ISSUE_DISPLAY_FILTERS_BY_LAYOUT serves a different part of the codebase (space/). This separation appears intentional rather than inconsistent.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Searching for old references to the removed constant.
rg "ISSUE_DISPLAY_FILTERS_BY_LAYOUT"

Length of output: 640


Script:

#!/bin/bash
# Check the definition and usage of both constants
echo "=== Searching for ISSUE_DISPLAY_FILTERS_BY_PAGE ==="
rg "ISSUE_DISPLAY_FILTERS_BY_PAGE"

echo -e "\n=== Checking constant definitions ==="
ast-grep --pattern 'export const ISSUE_DISPLAY_FILTERS_BY_$_'

Length of output: 7709

web/core/components/issues/issue-layouts/index.ts (1)

15-15: Export of layout-icon successfully adds modularity

Exporting from "./layout-icon" integrates the new layout icon component into the existing issue layout exports, enhancing discoverability and modular organization.

web/core/components/issues/issue-layouts/layout-icon.tsx (1)

4-19: Switch-based icon rendering is clear and concise

The IssueLayoutIcon component leverages a straightforward switch statement to render the correct icon based on EIssueLayoutTypes. This design is easy to follow, and the default case returning null prevents unintended outcomes. As a minor enhancement, you could replace the switch with a mapping object if you ever need a more scalable solution.

web/ce/components/issues/worklog/activity/filter-root.tsx (2)

5-5: Centralization of constants is consistent with the new structure

Importing from @plane/constants ensures a coherent and centralized source of constants and types. This helps maintain consistency across the codebase.


23-23: Confirm translation keys are defined

Switching from label to labelTranslationKey helps with internationalization. Verify that these translation keys exist in the relevant i18n files and are correctly translated.

✅ Verification successful

Translation keys are properly defined

The translation keys are correctly defined in the i18n files and follow the established pattern. The keys like "common.updates" and "comments" exist in the translation system and are properly structured.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Searching for labelTranslationKey usage in translation files
fd --extension json | xargs rg '"labelTranslationKey"'

Length of output: 56


Script:

#!/bin/bash
# Find actual usage of labelTranslationKey to see the values
rg "labelTranslationKey" -A 2 -B 2

# Look for translation/i18n files with various extensions
fd -e yml -e yaml -e json -e ts -e js | rg -i "translation|i18n|locale|lang"

# Look for i18n setup files
fd -e ts -e js -e json | rg -l "i18next|i18n|translations"

Length of output: 9620


Script:

#!/bin/bash
# Check for the specific translation keys in the translation files
cat packages/i18n/src/locales/en/translations.json | grep -A 1 '"common"'
cat packages/i18n/src/locales/en/translations.json | grep -A 1 '"updates"'
cat packages/i18n/src/locales/en/translations.json | grep -A 1 '"comments"'

Length of output: 495

web/core/components/issues/issue-layouts/filters/header/display-filters/order-by.tsx (3)

3-3: Imports from @plane/constants improve maintainability

Pulling ISSUE_ORDER_BY_OPTIONS from the centralized constants module fosters more maintainable code and reduces duplicated definitions.


28-28: Converted static text to translatable string

Using t("common.order_by.label") instead of a hardcoded string strengthens i18n support and keeps the UI consistent across languages.


39-39: Dynamic translation props enhance localization

Retrieving the title text via t(orderBy.titleTranslationKey) ensures that each filter option is properly localized. This is a great step toward comprehensive internationalization.

web/core/components/issues/issue-layouts/filters/header/display-filters/extra-options.tsx (2)

3-3: Use of useTranslation is well-integrated
No issues found with the import; it cleanly introduces i18n functionality.


48-48: Verify translation usage
Passing the translation key to t(...) is correct. Ensure that fallback behavior is handled if the key is missing.

space/core/components/issues/filters/priority.tsx (4)

6-6: Importing useTranslation
This import indicates a shift to i18n-based labels. No issues found.


22-23: useTranslation hook usage
Good step towards enhanced localization. Ensure that all relevant priority translation keys are covered.


47-47: Priority title now uses translation key
Using title={t(priority.titleTranslationKey)} is consistent with the new i18n setup.


51-51: Localized "no matches found" message
Good approach for user-friendly internationalized messages.

web/core/components/issues/issue-layouts/filters/header/filters/priority.tsx (6)

5-5: Reorganized imports
Consolidating constants in @plane/constants improves maintainability.


6-7: useTranslation import
Adopting the i18n framework helps unify translations across components.


21-21: Initialize translation
Fine usage of the useTranslation hook to retrieve the t function.


31-31: Translate the "Priority" label
Using t("common.priority") keeps the UI consistent for international audiences.


44-44: Priority title translation
Properly transitioning priority titles to use t(priority.titleTranslationKey).


48-48: No matches found
Applying t("common.no_matches_found") is consistent with standard i18n usage.

web/core/components/command-palette/actions/issue-actions/change-priority.tsx (3)

8-9: Consolidated import statement
Importing both EIssuesStoreType and ISSUE_PRIORITIES from @plane/constants streamlines code references. The useTranslation addition aligns with the broader i18n approach.


26-26: useTranslation hook
Brings essential i18n functionality into this component, ensuring user-facing strings can be localized.


53-53: Priority title localization
Using t(priority.titleTranslationKey) is consistent with the rest of the PR's i18n changes.

web/core/components/issues/issue-layouts/filters/header/layout-selection.tsx (6)

5-6: Centralized constants usage
Good job referencing EIssueLayoutTypes and ISSUE_LAYOUTS from @plane/constants. This helps maintain a consistent, centralized source of truth for issue layout types.


7-7: Adoption of translation hook
Using useTranslation seamlessly incorporates i18n. This aligns with the broader localization efforts in the codebase.


11-11: Consistent usage of IssueLayoutIcon
Importing IssueLayoutIcon from @/components/issues promotes reusability and ensures a standardized icon design.


24-24: Check for missing translations
While useTranslation is correctly initialized, confirm that corresponding translation keys exist for all layouts to prevent fallback text issues.


34-34: Tooltip translation
Replacing the raw layout title with t(layout.i18n_title) neatly integrates i18n. Be sure each layout’s i18n_title is properly defined in your translation files.


42-43: Improved icon rendering
Switching from a direct layout icon reference to <IssueLayoutIcon layout={layout.key} /> ensures consistent styling and icon logic across the application.

web/core/components/issues/issue-layouts/filters/header/display-filters/sub-group-by.tsx (3)

3-4: Use of shared constants and translation
Importing ISSUE_GROUP_BY_OPTIONS from @plane/constants and integrating useTranslation aligns this file with the central refactoring strategy.


18-19: Initialized translation
Properly setting up const { t } = useTranslation() lays the foundation for localized titles. This is consistent with the codebase-wide i18n approach.


46-46: Localized sub-group titles
Using t(subGroupBy.titleTranslationKey) in FilterOption is a great step for internationalization. Verify that each titleTranslationKey is defined to avoid displaying raw keys.

web/core/components/issues/issue-layouts/filters/header/display-filters/issue-grouping.tsx (4)

3-3: Centralized translation usage
Leaning on @plane/i18n for useTranslation ensures consistency across various components.


15-23: Flexible issue filter options
Defining ISSUE_FILTER_OPTIONS with i18n_title keys is a neat approach. Make sure all keys have corresponding translations to avoid fallback errors.


32-34: Translation hook initialization
The useTranslation hook is properly initiated, which follows the design pattern found throughout the codebase.


38-40: Entity-based label pluralization
Using count to dynamically pluralize the entity label is effective for i18n. Confirm that plural forms are properly handled in all supported languages.

web/core/components/issues/issue-layouts/filters/header/display-filters/group-by.tsx (4)

3-4: Unified constants and translation integration
Importing ISSUE_GROUP_BY_OPTIONS from @plane/constants and pulling in useTranslation from @plane/i18n maintains consistency with the global refactoring efforts.


18-19: Translation hook setup
Using const { t } = useTranslation() is in line with the localization strategy seen in other modules.


28-28: Internationalized title
Revising a static "Group by" label to t("common.group_by") enhances language coverage.


48-48: Ensuring translation key coverage
Applying t(groupBy.titleTranslationKey) is great for i18n. Double-check that each title key is defined to prevent gaps in localization.

packages/constants/src/issue/layout.ts (3)

8-14: Enum definition is clear and self-explanatory.
Using an explicit enum for layout types improves readability and helps avoid typos.


16-23: Nice use of Record type for mapping.
This structure is concise, strongly typed, and enforces consistency in your i18n titles/labels.


45-71: Ensure i18n keys exist for each layout.
It looks good overall. Just confirm that corresponding translation strings (issue.layouts.title.* and issue.layouts.*) are properly defined in your translation files.

web/core/components/inbox/inbox-filter/filters/priority.tsx (4)

5-6: Good move: referencing constants and translations from a shared library.
Importing ISSUE_PRIORITIES and useTranslation from centralized modules fosters code consistency and reusability.


22-22: Proper usage of the translation hook.
Extracting t at the top ensures simpler translation calls within the component.


50-50: Localized priority titles.
Replacing the previous static label with t(priority.titleTranslationKey) aligns well with the i18n approach.


54-54: Consistent “No matches found” translation.
Utilizing t("common.no_matches_found") ensures a uniform message across the app.

web/core/components/issues/issue-detail/issue-activity/activity-filter.tsx (4)

4-5: Imports are well-structured.
Bringing in typed filter definitions from @plane/constants and translation from @plane/i18n keeps things organized.


19-20: Translation hook usage is appropriate.
Extracting t once at the beginning reduces repeated imports and fosters clarity.


32-32: Filter button label is now translatable.
Replaces the hardcoded "Filters" label with t("common.filters") for better i18n coverage.


60-60: Translation for filter labels.
{t(item.labelTranslationKey)} is a clean approach to dynamically loading localized labels.

web/core/components/inbox/inbox-filter/applied-filters/priority.tsx (4)

6-6: Centralized import of ISSUE_PRIORITIES.
Consistent with the rest of the PR, pulling from @plane/constants avoids scattered constant definitions.


7-7: Importing translation hook from @plane/i18n.
This continues the pattern of properly localizing UI elements.


15-15: Translation hook usage is coherent.
Using a single const { t } = useTranslation(); makes subsequent translation calls cleaner and more uniform.


39-39: Replacing static text with translation.
Using t(optionDetail?.titleTranslationKey) ensures dynamic, locale-specific rendering of filter labels.

space/core/components/issues/navbar/layout-selection.tsx (2)

8-9: Ensure translation coverage is complete
By introducing useTranslation here, verify that all expected locales include the translation keys being referenced (e.g., layout.titleTranslationKey). Otherwise, missing keys may result in fallback or unclear text.


24-25: No immediate concerns with the new translation hook
This hook usage is straightforward and aligns with typical i18n patterns.

web/core/components/graphs/issues-by-priority.tsx (2)

3-3: Correct import location
Importing ISSUE_PRIORITIES from @plane/constants is consistent with the refactoring efforts to centralize constants.


76-76: Unique gradient ID ensures no collisions
Using gradient_${p.key} is a clean approach that reduces the risk of naming collisions compared to potentially using titles. Make sure each p.key is guaranteed to be unique.

web/core/components/issues/issue-layouts/group-drag-overlay.tsx (4)

3-4: Constants import and i18n usage align with ongoing refactor
Bringing ISSUE_ORDER_BY_OPTIONS and useTranslation into this file is consistent with the centralization of issue constants and i18n.


34-36: i18n hook is correctly set up
No issues found with the t function setup.


38-40: Verify object existence before attempting translation
You’re safely handling the case where no matching orderByObj is found. Confirm that the translation key you’re using defaults to a non-empty string in all locales.


78-78: Parameter-based translation
Utilizing entity: isEpic ? "epic" : "issue" is a neat example of dynamic translation. Looks good!

web/core/components/dropdowns/layout.tsx (5)

5-7: Refactoring constants and hooking in translation
Importing EIssueLayoutTypes, ISSUE_LAYOUT_MAP, and useTranslation from @plane/* is consistent with the codebase’s updated structure.


12-13: New icon component usage
The import of IssueLayoutIcon is well-placed and consistent with the layout changes.


23-24: i18n hook placement
Positioning the translation hook near other computed values is a clean approach, ensuring translations are readily accessible for dynamic content below.


44-45: Appropriate layout icon and label translation
Good job using the dedicated icon and dynamic translation for the dropdown’s button content.


56-57: Consistent translation for item labels
Maintains consistency with the button content, ensuring uniform translation coverage across all dropdown items.

web/core/components/issues/issue-detail/issue-activity/activity-comment-root.tsx (1)

4-4: Leverage new import location.

Adopting @plane/constants is a good step towards centralizing and standardizing constants usage across the codebase.

web/core/components/issues/issue-layouts/filters/header/display-filters/display-properties.tsx (3)

4-7: Centralized constants and new i18n import.

Bringing ISSUE_DISPLAY_PROPERTIES from @plane/constants and useTranslation from @plane/i18n moves toward cleaner, more maintainable code while ensuring a unified translation approach.


33-34: Hook usage for translations.

Good addition of useTranslation(). This ensures the entire component can seamlessly manage locale-based strings.


64-64: Translation key verification.

Confirm that "issue.display.properties.label" exists within your translation files to avoid rendering errors or missing translations.

space/core/components/issues/issue-layouts/kanban/default.tsx (3)

4-4: Centralized i18n import.

Importing useTranslation from @plane/i18n aligns this Kanban layout with the project's global localization strategy.


57-59: Enhanced localization support.

const { t } = useTranslation() enables dynamic, multi-lingual Kanban board titles and labels.


102-102: Fallback handling in title.

Leveraging subList.name when i18n_name is absent is a sound approach. Verify that keys in subList.i18n_name are valid translations to avoid undefined text.

✅ Verification successful

Translation implementation is robust and safe.

The translation system has multiple layers of fallback handling:

  • Component falls back to subList.name if i18n_name is undefined
  • Translation function falls back to the key if translation is missing
  • Translation store falls back to default language
  • Comprehensive error handling is in place
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
fd -t f | xargs rg "subList\.i18n_name"

Length of output: 449


Script:

#!/bin/bash
# Search for type definitions and interfaces that might contain i18n_name
ast-grep --pattern 'interface $_ {
  $$$
  i18n_name$_
  $$$
}'

# Search for translation key patterns and configuration
fd -e json -e yaml -e yml | grep -i "i18n\|translation" | xargs cat

# Search for where subList might be defined or populated
rg "subList.*=" -A 2 -B 2

Length of output: 97013


Script:

#!/bin/bash
# Search for i18n_name assignments and definitions
rg "i18n_name.*=" -A 2 -B 2

# Search for translation configuration files
fd -e ts -e tsx | grep -i "i18n\|translation" | xargs cat

# Search for translation function usage
ast-grep --pattern 't($_)'

Length of output: 64534

web/core/components/issues/archived-issues-header.tsx (6)

5-7: Refactor import statements and i18n usage.

Introducing ISSUE_DISPLAY_FILTERS_BY_PAGE and useTranslation centralizes filter definitions and streamlines localization.


31-32: Proper translation hook usage.

Implementing const { t } = useTranslation() here is consistent with the move toward fully localized interfaces.


77-77: Translated dropdown title.

Switching to t("common.filters") supports multilingual "Filters" labels.


84-84: Refined filter management.

Using ISSUE_DISPLAY_FILTERS_BY_PAGE.archived_issues[activeLayout] is consistent with the new page-based filter organization.


91-91: Translated display label.

Changing "Display" to t("common.display") ensures the header is fully localized.


97-97: Validate filter mappings.

Double-check that ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout] exists for all possible activeLayout values to avoid runtime errors.

✅ Verification successful

The filter mappings are valid and safe

The hardcoded activeLayout = "list" is safe as it's a valid layout type and ISSUE_DISPLAY_FILTERS_BY_PAGE.issues includes proper configuration for the list layout. The code also handles undefined cases gracefully through the ternary operator.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
fd -t f | xargs rg "ISSUE_DISPLAY_FILTERS_BY_PAGE\.issues"

Length of output: 3429


Script:

#!/bin/bash
# Find the constant definition and related types
echo "=== Searching for ISSUE_DISPLAY_FILTERS_BY_PAGE definition ==="
rg -A 10 "export const ISSUE_DISPLAY_FILTERS_BY_PAGE" packages/constants/src/issue/filter.ts

echo -e "\n=== Searching for layout-related type definitions ==="
ast-grep --pattern 'type $_ = {
  $$$
  layout: $_
  $$$
}'

echo -e "\n=== Searching for activeLayout assignments ==="
rg "activeLayout.*=" 

Length of output: 14028


Script:

#!/bin/bash
# Find layout type definitions
echo "=== Searching for layout type/enum definitions ==="
rg "type.*Layout|enum.*Layout" -A 5

echo -e "\n=== Searching for complete ISSUE_DISPLAY_FILTERS_BY_PAGE definition ==="
rg "ISSUE_DISPLAY_FILTERS_BY_PAGE.*=.*{" -A 20 packages/constants/src/issue/filter.ts

Length of output: 6826


Script:

#!/bin/bash
echo "=== Searching for ISSUE_DISPLAY_FILTERS_BY_PAGE structure ==="
rg "ISSUE_DISPLAY_FILTERS_BY_PAGE" -B 2 -A 30 packages/constants/src/issue/filter.ts

Length of output: 1803

web/core/components/profile/profile-issues-filter.tsx (2)

5-7: Use consistent translation keys and verify fallback.
By using @plane/i18n and referencing ISSUE_DISPLAY_FILTERS_BY_PAGE, you're ensuring i18n support and a centralized filter configuration. Just confirm that all keys passed to t() exist in the translation files and that profile_issues is a valid key in ISSUE_DISPLAY_FILTERS_BY_PAGE.
[approve]


110-110: Confirm translation key availability.
You replaced the hard-coded "Filters" text with t("common.filters"). Verify that key is present in the translation resources to avoid missing translation fallback.

space/core/components/issues/peek-overview/issue-properties.tsx (3)

6-6: Great addition of the translation hook.
Importing useTranslation here enables dynamic, user-friendly text.


28-29: Initialize translation early for better clarity.
Grabbing t right after imports clarifies your i18n usage. Ensure you have tested all possible fallback scenarios (e.g., missing translation keys).


101-101: Leverage fallback for missing priority translation.
Using t(priority?.titleTranslationKey || "common.none") is a neat fallback. Confirm "common.none" is present in translation resources and consider logging or tracking missing keys.
[approve]

packages/types/src/issues.d.ts (2)

18-18: Correct usage of TIssueExtraOptions.
The import of TIssueExtraOptions from @plane/types clarifies its usage. Just confirm it’s consistently exported and utilized, preventing type mismatch.


226-226: Allowing localization via i18n_name is beneficial.
Making the i18n_name optional provides flexibility for multilingual support without breaking existing implementations.

web/app/[workspaceSlug]/(projects)/workspace-views/header.tsx (2)

8-8: Transition to the new constant.
Replacing ISSUE_DISPLAY_FILTERS_BY_LAYOUT with ISSUE_DISPLAY_FILTERS_BY_PAGE consolidates filter configurations. Ensure the old constant is not used elsewhere to avoid confusion or inconsistencies.


120-120: Avoid potential undefined filter set.
ISSUE_DISPLAY_FILTERS_BY_PAGE.my_issues.spreadsheet looks correct, but confirm my_issues and spreadsheet keys exist in ISSUE_DISPLAY_FILTERS_BY_PAGE.

web/core/constants/dashboard.ts (1)

17-17: Adopted consistent naming convention for gradients.

Renaming from camelCase (e.g., gradientUrgent) to snake_case (gradient_urgent) helps maintain uniform naming practices across the codebase. This change improves code readability and consistency.

Also applies to: 30-30, 43-43, 56-56, 69-69

web/core/components/issues/filters.tsx (6)

6-7: Ensure constant references remain valid.

The addition of new imports from @plane/constants is good. Verify all references to the newly introduced constants or mappings, such as ISSUE_STORE_TO_FILTERS_MAP, to ensure that the usage matches the updated definitions elsewhere in the codebase.


8-8: Add i18n import.

Bringing in useTranslation from @plane/i18n aligns with the broader internationalization effort. Well done.


37-38: Introduce translation function.

Using const { t } = useTranslation(); is correctly placed at the component level. Keep an eye on potential performance implications if the translation logic expands significantly.


116-120: Use i18n for "Filters" label.

Replacing the hardcoded "Filters" label with t("common.filters") is a clean approach to support multiple languages.


136-136: Use i18n for "Display" label.

Changing "Display" to t("common.display") ensures consistency with the i18n workflow.


150-150: Use i18n for "Analytics" label.

Replacing "Analytics" with t("common.analytics") completes the translation alignment.

packages/constants/src/issue/common.ts (14)

1-5: Imports from @plane/types verified.

All imported types (TIssueGroupByOptions, TIssueOrderByOptions, etc.) are relevant to subsequent definitions. Looks good.


9-10: TIssuePriorities type definitions look good.

This sets a clear domain enumeration for different priority levels.


11-16: TIssueFilterPriorityObject shape.

Declaring a structured object type for filter priorities clarifies usage across the codebase. Good approach.


18-30: EIssueGroupByToServerOptions enum.

Mapping local group attributes to server fields improves clarity and maintainability.


45-48: EIssueServiceType enum clarity.

Distinguishing between "issues" and "epics" is straightforward and beneficial.


50-64: EIssuesStoreType coverage.

Covers multiple store scenarios thoroughly, which helps unify interactions in different contexts.


66-69: EIssueCommentAccessSpecifier usage.

A simple enum for comment access scopes fosters clarity in security. No issues found.


71-76: EIssueListRow enum.

Enumerating row types for list rendering clarifies UI representations.


104-111: DRAG_ALLOWED_GROUPS covers valid groupBy cases.

The array enumerates all relevant groupBy fields for drag-and-drop. Looks correct.


113-121: TCreateModalStoreTypes is consistent.

Narrowing the acceptable store types helps ensure correct usage when displaying or creating issues/modals.


123-138: Comprehensive ISSUE_GROUP_BY_OPTIONS.

Providing translation keys for grouping conceptual items moves us toward full i18n coverage.


140-150: ISSUE_ORDER_BY_OPTIONS.

Similar approach for ordering as with grouping. Presents a consistent user experience.


152-170: ISSUE_DISPLAY_PROPERTIES_KEYS definition.

This array enumerates the possible display fields for issues effectively.


172-217: ISSUE_DISPLAY_PROPERTIES definitions align well.

Mirroring each key with a titleTranslationKey fosters clarity and i18n readiness.

web/app/[workspaceSlug]/(projects)/profile/[userId]/mobile-header.tsx (9)

9-15: Imports from @plane/constants look good.
All constants—EIssueLayoutTypes, EIssueFilterType, EIssuesStoreType, ISSUE_LAYOUTS, and ISSUE_DISPLAY_FILTERS_BY_PAGE—are used consistently in this file. No issues found.


16-16: Inline comment is fine.
This code comment (“// plane i18n”) clarifies the upcoming import. No concerns.


17-17: i18n import is consistent.
This import aligns well with the usage of useTranslation below.


23-23: UI components import is valid.
All named imports are in use. The grouping under @/components/issues is consistent.


31-32: Translation usage is correct.
Destructuring the translation function is straightforward and consistent with its usage throughout the component.


161-161: Add fallback for missing layouts.
Currently, it returns undefined if activeLayout is not found in profile_issues. Consider providing a graceful fallback to improve resilience.


175-179: Consistent translation usage for "display".
This mirrors your usage for “layout” and “filters.” Confirm "common.display" is present in your i18n resources.


186-186: Ensure no error on missing layout keys.
Same fallback concern as above—consider a default or error message if activeLayout doesn’t match the profile_issues map.


141-142: Icon + i18n usage for layouts is clear.
The IssueLayoutIcon usage matches the layout key. Just verify each i18n_title is present in translation files to prevent missing translations.

web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/draft-issues/header.tsx (6)

7-9: Imports and translation setup look correct.
Switching to ISSUE_DISPLAY_FILTERS_BY_PAGE and useTranslation for i18n is consistent with the overall refactor strategy.


26-27: Translation hook usage is good.
Destructuring t from useTranslation() is standard practice and is used consistently below.


128-131: Translation-based FiltersDropdown is correctly implemented.
Using t("common.filters") for both title and the user-facing button text is appropriate.


138-138: Fallback for display filters.
ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout] may be undefined if the layout key is unrecognized. Consider a more robust fallback strategy.


147-147: Title translation for "display" is aligned with i18n.
This ensures consistent text across the UI.


150-150: Add default path for missing layout.
Similar fallback comment as above. If activeLayout is undefined or missing, consider a safe default to avoid potential UI errors.

web/core/store/base-command-palette.store.ts (1)

2-2: Type import consolidation.
Importing EIssuesStoreType and TCreateModalStoreTypes from @plane/constants follows the new centralized approach for constants and is consistent with the refactor.

web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/mobile-header.tsx (7)

9-15: Constants import looks consistent.
Bringing in EIssueLayoutTypes, EIssueFilterType, EIssuesStoreType, ISSUE_LAYOUTS, and ISSUE_DISPLAY_FILTERS_BY_PAGE aligns with the global refactor.


16-17: i18n import is straightforward.
Using useTranslation for multi-language support is in line with the rest of the PR.


24-29: Clear usage of issues layouts components.
These imports from @/components/issues/issue-layouts reduce duplication and promote consistency.


39-39: Destructuring t is good.
Occupies minimal scope and is consistent with your i18n approach.


154-154: Filter selection fallback.
Again, ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout] can be undefined if an unexpected layout key is passed. Consider handling that gracefully.


177-177: Display filter fallback.
Same fallback concern—add a default or a safety check for missing layout keys.


41-43: Local layouts array includes translation keys.
Ensure each i18n_title is actually defined in your language files.

web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/mobile-header.tsx (13)

9-15: New constants imported from @plane/constants.
No issues identified with these imports; they appear consistent with the rest of the refactoring.


16-17: Successfully integrating i18n for translations.
No concerns; good use of useTranslation.


24-29: Imports from issue-layouts to manage filters and icons.
All components appear correctly referenced. No issues found.


36-37: Initializing the translation function.
Implementation is correct and matches usage across the component.


39-41: Layout definitions now using translation keys.
Ensure that the translation files contain the keys for "issue.layouts.list", "issue.layouts.kanban", and "issue.layouts.calendar."


120-120: Using i18n for the "Layout" label.
Straightforward update. No issues here.


142-142: Title translation for "Filters".
Implementation follows the i18n pattern consistently.


146-146: Button label translation for "Filters".
No issues; consistent with the rest of the translation approach.


158-158: Conditional usage of ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout].
Verify that activeLayout always maps to valid filter entries in ISSUE_DISPLAY_FILTERS_BY_PAGE.issues.


170-170: Title translation for "Display".
Integration with t("common.display") looks good.


174-174: Button label translation for "Display".
No issues; consistent usage of translation keys.


181-181: Same conditional usage of ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout].
Please confirm that all possible layouts have corresponding filter definitions.


197-197: Using i18n for the "Analytics" label.
Implementation is correct, no concerns.

web/core/components/issues/issue-layouts/roots/all-issue-layout-root.tsx (2)

7-13: Refactoring imports to @plane/constants.
No concerns; these constants appear to be used consistently throughout the code.


78-78: Using ISSUE_DISPLAY_FILTERS_BY_PAGE.my_issues.spreadsheet.filters.
Please confirm that my_issues.spreadsheet.filters is always defined to avoid runtime errors when referencing .includes(...).

web/core/components/issues/issue-detail/issue-activity/root.tsx (19)

6-6: Added imports for new activity filter types.
No issues with this import.


8-8: Include useLocalStorage from @plane/hooks.
Change is consistent with storing activity filters locally.


9-9: Importing useTranslation for i18n support.
Looks good.


10-10: Minor import reorganization.
No concerns here.


45-45: Initializing translation function with { t }.
Implementation follows best practices.


93-93: Toast title: using t("common.success").
Good use of localized toast messages.


95-95: Toast message: t("issue.comments.create.success").
Ensure this key is defined in translation files.


100-100: Toast title: t("common.error").
No issues with structure.


102-102: Toast message: t("issue.comments.create.error").
Check for missing translation entries.


111-111: Toast title: t("common.success").
Implementation is consistent.


113-113: Toast message: t("issue.comments.update.success").
Verify the translation key is present.


117-117: Toast title: t("common.error").
No issues detected.


119-119: Toast message: t("issue.comments.update.error").
Double-check the translation key.


128-128: Toast title: t("common.success").
No concerns here.


130-130: Toast message: t("issue.comments.remove.success").
Confirm translation entry is defined.


134-134: Toast title: t("common.error").
Implementation is standard.


136-136: Toast message: t("issue.comments.remove.error").
Ensure you have the correct translation key.


155-155: Error message for uploading comment asset.
Make sure t("issue.comments.upload.error") is included in translations.


169-169: Activity section title using i18n.
No issues found.

web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/mobile-header.tsx (15)

8-14: Refactoring imports to @plane/constants.
Imports look correct for managing layouts and filters. No issues.


15-15: Comment marker for i18n.
No functional changes; just clarifies context.


16-16: Using useTranslation from @plane/i18n.
Enhances internationalization support.


23-23: Importing new filter/layout components.
No concerns; references appear correct.


30-31: Declaring translation hook for the Cycle Issues Mobile Header.
Usage aligns with the pattern in the rest of the code.


36-38: Defining layouts array with i18n translation keys.
Verify corresponding translations exist for "issue.layouts.*".


136-138: Custom menu button label for layout using t("common.layout").
Implementation is straightforward; no issues.


150-151: Layout menu items with icons and localized titles.
Proper usage of IssueLayoutIcon and translation keys.


157-157: Dropdown title for filters using i18n.
Looks correct.


161-161: Button label "Filters" localized.
No concerns; consistent with the rest of i18n usage.


171-171: Conditional usage of ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout].
Confirm the object path is valid for all layout states.


185-185: Title for "Display" in i18n.
No issues found.


189-189: Button label for "Display".
Implementation is consistent across the board.


196-196: Same usage of ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout].
Ensure fallback is handled properly.


213-213: Localization of "Analytics" label.
No concerns.

web/core/components/issues/issue-layouts/kanban/default.tsx (3)

3-4: Integrate i18n import.
The addition of useTranslation is straightforward and will help localize component text as needed.


94-95: Initialize translation hook.
Good approach to localize strings in the component. No issues found.


167-167: Fallback logic verified.
Using subList.i18n_name if available, otherwise subList.name, ensures a proper fallback for untranslated keys.

web/core/components/workspace/views/form.tsx (13)

7-8: Added imports for constants and translation.
This enhances code clarity and readability.


43-44: Translation function established.
Proper usage of t for any subsequent translatable strings.


117-119: Dynamic title for create/update.
Smart use of translations for the form's heading.


126-126: Localized input requirement message.
Providing a translated error message is good for UX.


129-129: Max length message localized.
Ensures consistent multi-language support for validation.


141-141: Placeholder text localized.
Enhances user-friendliness in different languages.


157-157: Description placeholder localized.
Minor but meaningful improvement for i18n.


172-172: Filters title translation.
Ensures the dropdown title remains consistent with the current locale.


192-192: Use of ISSUE_DISPLAY_FILTERS_BY_PAGE.
Updating the reference to use the new constant aligns with the broader refactor.


209-209: Display dropdown title.
Localizing the display filter label keeps the UI consistent.


211-211: Replaced old layout filter constant.
Ensures the same pattern used throughout the code for display filters.


249-249: Localized cancellation text.
Allows a better user experience across languages.


252-258: Localized create/update button labels.
Properly handles progress states and fallback text.

web/core/components/issues/issue-layouts/filters/header/filters/filters-selection.tsx (3)

5-6: New i18n import.
No issues; aligns well with the code’s translation pattern.


70-71: Translation hook usage.
Clean extraction of the translation function for placeholders, filter labels, etc.


104-104: Search placeholder localized.
Improves search field usability for international users.

space/core/components/issues/issue-layouts/kanban/swimlanes.tsx (5)

3-3: Import the translation hook.
Aligns with the common approach across the codebase.


135-135: Translation hook used in header component.
No further concerns.


138-142: Conditional title translation.
Good fallback to group.name if i18n_name is missing.


239-241: Hook placement noted.
Clear inline comment for i18n usage. Looks consistent.


275-275: Sub-group header.
Using i18n_name fallback to group.name ensures continuity of naming convention.

web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx (2)

10-10: Remove deprecated constant references if any remain.
Importing ISSUE_DISPLAY_FILTERS_BY_PAGE is correct. Ensure all previous references to ISSUE_DISPLAY_FILTERS_BY_LAYOUT have been properly removed throughout the project.


260-260: Same suggestion as above regarding unknown layout keys.
This duplication of code with line 248 can benefit from the same fallback improvement.

web/core/components/issues/issue-layouts/list/list-group.tsx (4)

8-10: Validate usage of new imports.
You've introduced DRAG_ALLOWED_GROUPS and useTranslation. Ensure that DRAG_ALLOWED_GROUPS is utilized correctly, and that translations are tested for correctness.


104-104: Destructuring t from useTranslation.
This is the correct approach for localizing strings in the component. Great job keeping localization consistent.


266-266: Great fallback to group.name.
Using i18n_name with a fallback to group.name ensures coverage for untranslated or missing keys. Keep up the good practice.


135-135: Verify the translation key is defined.
"common.load_more" should be confirmed to exist in locale files to prevent missing translation warnings.

web/core/components/issues/issue-layouts/kanban/swimlanes.tsx (6)

3-3: Importing useTranslation is aligned with new i18n strategy.
Good job incorporating translations throughout the component.


66-66: Destructure t from useTranslation.
This will help you localize dynamically. Ensure all relevant text is passed through t().


74-74: Fallback logic for group title is well-implemented.
Using t(_list.i18n_name) when available and defaulting to _list.name is a solid approach for multilingual support.


79-79: Likely a minor formatting update.
No functional impact observed.


159-159: Consistent usage of the translation hook.
{ t } = useTranslation(); will streamline i18n usage, matching other components.


170-170: Localized sub-group title with a fallback.
Great pattern for ensuring that readers see localized text when available.

web/core/components/issues/issue-layouts/kanban/kanban-group.tsx (3)

9-11: Use of constants and i18n imports looks consistent.

Importing DRAG_ALLOWED_GROUPS and useTranslation is a good step toward centralizing logic and ensuring multilingual support. Ensure that any references to previously imported constants or i18n resources have been updated or removed to avoid confusion.


161-161: Localized warning title.

Replacing "Warning!" with the translatable t("common.warning") improves i18n readiness. Double-check that the common.warning key is properly defined in translation files to avoid runtime issues.


260-260: Localized “Load More” string.

Using t("common.load_more") for the pagination trigger is aligned with i18n best practices. Confirm the translation availability, and consider a fallback for users with incomplete translation sets.

web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(detail)/header.tsx (7)

10-12: Consistent constants and i18n imports.

The addition of ISSUE_DISPLAY_FILTERS_BY_PAGE and useTranslation aligns with the codebase refactor for improved filter management and localization. Verify that all former references to older constants have been replaced to prevent conflicts.


189-189: Localized breadcrumb label.

Changing "Cycles" to t("common.cycles") is a solid step toward comprehensive localization. Ensure the common.cycles key is defined consistently across all translations.


244-244: Localized filters title.

Replacing the hardcoded "Filters" label with t("common.filters") maintains consistency. Confirm that common.filters is correctly defined in the translation files.


252-252: Conditional layout usage.

activeLayout ? ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout] : undefined properly safeguards against undefined layouts. Ensure that ISSUE_DISPLAY_FILTERS_BY_PAGE.issues covers all necessary layout types to avoid edge-case bugs.


263-266: Localized “Display” dropdown label and layout condition.

Shifting from a static label to t("common.display") is helpful for i18n. The condition activeLayout ? ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[activeLayout] : undefined matches the filter approach used elsewhere; watch for alignment with custom or future layouts as the application evolves.


281-281: Localized “Analytics” label.

Using t("common.analytics") is consistent with new i18n guidelines. Test whether the analytics key is properly set across multiple languages, especially if analytics is optional in some regions.


292-292: Localized “Add issue” button.

Using t("issue.add") for the button text is a clear improvement, ensuring multi-language support. Double-check that other “Add” variants around the codebase are replaced for uniformity.

web/core/components/views/form.tsx (9)

8-10: Use of ISSUE_DISPLAY_FILTERS_BY_PAGE and useTranslation ensures consistency.

The shift from ISSUE_DISPLAY_FILTERS_BY_LAYOUT is consistent with the new approach. Good job consolidating constants for clarity.


48-49: Appropriate i18n hook setup.

Using the t function properly. Validate that each translated key has a fallback strategy to avoid rendering raw keys.


145-147: Enhanced form header text.

Localizing "Create" and "Update" with t("view.create.label") and t("view.update.label") is a direct i18n improvement. Confirm the translation keys exist in all supported languages.


194-197: Title field validation messages localized.

Replacing hard-coded messages with t("form.title.required") and t("form.title.max_length") fosters multi-language readiness. Keep the validation step consistent across other fields.


226-226: Localized description placeholder.

Replacing the static placeholder with t("common.description") matches the i18n approach. Ensure consistent usage in any related text areas or forms.


259-259: Localized filters dropdown title.

Using t("common.filters") here aligns with the rest of the code’s i18n. Verify label usage in similar dropdowns for uniform interface design.


279-279: Display filter logic parameter.

ISSUE_DISPLAY_FILTERS_BY_PAGE.issues[displayFilters.layout] is a sensible approach. Confirm each layout key is recognized and tested, especially for custom or less-used layouts.


295-295: Localized “Display” label for second filters dropdown.

title={t("common.display")} ensures consistent text translation. This helps unify UI across different display settings.


339-339: Localized “Cancel” button.

Using t("common.cancel") helps keep the interface consistent. Check for any missing synonyms or partial usage in other forms.

packages/constants/src/issue/filter.ts (1)

522-529: Validate type casting in filterActivityOnSelectedFilters.

The filter directly casts activity.activity_type to TActivityFilters. Verify that activity_type will always match the enum values in TActivityFilters, or add safeguards (e.g., a type-guard or narrowing) to avoid runtime errors if an unexpected activity_type is introduced in future changes.

web/core/components/dropdowns/priority.tsx (3)

8-8: Good switch to the centralized constants.

Using ISSUE_PRIORITIES from @plane/constants promotes consistency and reduces maintenance overhead for priority-related data scattered across the codebase.


299-303: Gracefully handle missing translation keys in TransparentButton.

If titleTranslationKey is absent, this line defaults to "common.priority". Confirm that "common.priority" is defined in your translation resources; otherwise, the string may remain untranslated or break the user experience.


328-328: Great use of localized placeholder.

Replacing the hardcoded "Priority" string with t("common.priority") improves overall consistency and ensures that the placeholder is translated for all supported locales.

web/core/components/issues/issue-layouts/utils.tsx (6)

14-14: Good choice to import ISSUE_PRIORITIES here.

Centralizing the logic for priority columns is a more maintainable approach, ensuring future priority additions or changes remain in sync.


86-87: Confirm that “All Issues” is still displayed properly.

By setting name to "" and using i18n_name: isEpic ? "epic.all" : "issue.all", confirm that corresponding translation keys exist and are handled in the UI as expected, particularly if the UI logic ever relies on name being non-empty.


161-162: Use translation key consistently for the “None” cycle row.

Replacing the literal "None" label with "common.none" is a healthy i18n practice. Double-check related usage or references to "None" in the codebase to ensure consistency and avoid accidental fallback to an empty string.


189-190: Apply translation best practices for modules.

Similar to cycles, ensure that using "common.none" for modules is consistent throughout the application. This helps keep user-facing text in sync across all features.


233-234: Set name carefully for priority columns.

You've assigned name: "" and rely on i18n_name: priority.titleTranslationKey. Confirm that any logic checking column.name is unaffected. If the UI or other code depends on name, it may need to handle empty strings correctly or switch to i18n_name.


715-715: Minor formatting note.

The closing curly brace is at the end of the file. No issues here—just a confirmation that the final new line is properly included to satisfy typical lint or formatting rules.

space/core/components/issues/issue-layouts/properties/priority.tsx (3)

3-3: Centralized i18n import looks good.

Pulling useTranslation directly from @plane/i18n is consistent with your app’s localization approach.


24-24: Good use of tooltipContent translations.

Switching from a hardcoded or direct priority_detail?.title to its titleTranslationKey ensures multi-language support. Just be sure these keys are present in your translation files.


29-29: Enable or disable text display dynamically.

Displaying the priority name conditionally with shouldShowName is clean. Confirm that your translations always return a non-empty string to avoid an empty space in the UI if no translation is found.

space/core/components/issues/issue-layouts/list/list-group.tsx (2)

5-5: LGTM! Good practice using the i18n hook.

The import and initialization of the useTranslation hook is correctly implemented.

Also applies to: 67-67


91-91: LGTM! String externalized properly.

The "Load More" text is correctly externalized using the translation key.

Also applies to: 91-91

packages/i18n/src/locales/fr/translations.json (3)

Line range hint 1-318: No changes to review in this section.

These are existing translations that weren't modified in this PR.


320-369: LGTM! Well-structured common translations.

The new hierarchical structure under "common" provides a clean organization of shared translations.


383-384: Well implemented pluralization rules.

Good use of ICU MessageFormat for handling plural forms in French.

Also applies to: 387-388

packages/i18n/src/locales/zh-CN/translations.json (3)

318-368: Well-organized hierarchical structure for common terms!

The centralization of common terms under the "common" section improves maintainability and reduces translation duplication.


382-383: Consistent pluralization support across entity types.

The implementation uses ICU MessageFormat for pluralization, maintaining consistency with other languages. While Chinese doesn't have grammatical plurals, this structure allows for potential variations in messaging based on count.

Also applies to: 386-387, 446-447


427-443: Well-structured error and success messages with clear user guidance.

The messages are properly organized by feature and include appropriate guidance for error recovery (e.g., "请稍后重试" - "Please try again later").

packages/i18n/src/locales/en/translations.json (1)

319-454: Excellent base translations with consistent terminology!

The English translations provide a solid foundation with:

  • Consistent sentence case usage
  • Clear and actionable error messages
  • Well-structured hierarchical organization

Comment on lines +9 to +21
const ISSUE_EXTRA_OPTIONS: {
key: TIssueExtraOptions;
titleTranslationKey: string;
}[] = [
{
key: "sub_issue",
titleTranslationKey: "issue.display.extra.show_sub_issues",
}, // in spreadsheet its always false
{
key: "show_empty_groups",
titleTranslationKey: "issue.display.extra.show_empty_groups",
}, // filter on front-end
];
Copy link
Contributor

@coderabbitai coderabbitai bot Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Missing translation keys need to be added
The translation keys issue.display.extra.show_sub_issues and issue.display.extra.show_empty_groups are not present in any of the translation files. These keys need to be added to all locale files (en, es, fr, ja, zh-CN) in:

  • packages/i18n/src/locales/*/translations.json
🔗 Analysis chain

Validate presence of newly introduced translation keys
The keys "issue.display.extra.show_sub_issues" and "issue.display.extra.show_empty_groups" look correct. Please ensure they exist in the relevant translation files and are fully localized.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify that the new translation keys exist. 
# Searches for "issue.display.extra.show_sub_issues" and "issue.display.extra.show_empty_groups" in the i18n resources.
rg "issue\.display\.extra\.show_sub_issues|issue\.display\.extra\.show_empty_groups" i18n

Length of output: 136


Script:

#!/bin/bash
# First, find potential translation files/directories
fd -t f "translations|i18n|locales|lang" --full-path

# Then find files with common translation file extensions
fd -e json -e yml -e yaml -e ts -e js --full-path | grep -i "translations\|i18n\|locales\|lang"

Length of output: 1416


Script:

#!/bin/bash
# Search for the translation keys in all translation files
rg "issue\.display\.extra\.show_sub_issues|issue\.display\.extra\.show_empty_groups" packages/i18n/src/locales/*/translations.json

# Also show the content of English translations file around any matching lines
rg -C 2 "issue\.display\.extra" packages/i18n/src/locales/en/translations.json

Length of output: 405

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai Run check again. Translation keys seem to be in place already.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathalav55 You are correct. I've verified that both translation keys issue.display.extra.show_sub_issues and issue.display.extra.show_empty_groups are present and properly translated in all locale files (en, es, fr, ja, zh-CN). I apologize for the initial confusion in my verification process.

🔗 Analysis chain



🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the specific translation keys in all translation files
echo "Searching for translation keys in all locale files..."
rg -A 1 "issue\.display\.extra\.show_sub_issues|issue\.display\.extra\.show_empty_groups" packages/i18n/src/locales/*/translations.json

Length of output: 446


Script:

#!/bin/bash
# Check the structure of translation files around "issue" and "display" sections
echo "Checking English translations structure..."
rg -C 5 '"issue":|"display":|"extra":' packages/i18n/src/locales/en/translations.json

echo -e "\nChecking all translation files for issue display section..."
rg -C 2 '"issue":\s*{' packages/i18n/src/locales/*/translations.json

Length of output: 1942


Script:

#!/bin/bash
# Check all locale files for the specific translation structure
echo "Checking translation keys in all locales..."
for locale in en es fr ja zh-CN; do
  echo -e "\nChecking $locale translations:"
  rg -A 3 '"extra":\s*{' "packages/i18n/src/locales/$locale/translations.json"
done

Length of output: 1410


Script:

#!/bin/bash
# Check all locale files for the specific translation structure with fixed pattern
echo "Checking translation keys in all locales..."
for locale in en es fr ja zh-CN; do
  echo -e "\nChecking $locale translations:"
  rg -B 1 -A 3 '"extra": {' "packages/i18n/src/locales/$locale/translations.json"
done

Length of output: 1405


Script:

#!/bin/bash
# Check all locale files for the specific translation keys using grep
echo "Checking translation keys in all locales..."
for locale in en es fr ja zh-CN; do
  echo -e "\nChecking $locale translations:"
  echo "Looking for 'show_sub_issues':"
  grep -A 1 "show_sub_issues" "packages/i18n/src/locales/$locale/translations.json"
  echo -e "\nLooking for 'show_empty_groups':"
  grep -A 1 "show_empty_groups" "packages/i18n/src/locales/$locale/translations.json"
done

Length of output: 2938


If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!

packages/constants/src/issue/layout.ts Show resolved Hide resolved
Comment on lines 78 to 102
export const ISSUE_PRIORITIES: {
key: TIssuePriorities;
titleTranslationKey: string;
}[] = [
{
key: "urgent",
titleTranslationKey: "issue.priority.urgent",
},
{
key: "high",
titleTranslationKey: "issue.priority.high",
},
{
key: "medium",
titleTranslationKey: "issue.priority.medium",
},
{
key: "low",
titleTranslationKey: "issue.priority.low",
},
{
key: "none",
titleTranslationKey: "common.none",
},
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

ISSUE_PRIORITIES partially mismatched with TIssueFilterPriorityObject.

While ISSUE_PRIORITIES includes key and titleTranslationKey only, TIssueFilterPriorityObject also expects className and icon. Consider updating ISSUE_PRIORITIES to include all fields or removing them from the type if not needed.

-export const ISSUE_PRIORITIES: {
-  key: TIssuePriorities;
-  titleTranslationKey: string;
-}[] = [
+export const ISSUE_PRIORITIES: TIssueFilterPriorityObject[] = [

Committable suggestion skipped: line range outside the PR's diff.

@@ -3,7 +3,7 @@ import isEmpty from "lodash/isEmpty";
import set from "lodash/set";
import { v4 as uuidv4 } from "uuid";
// plane constants
import { EIssueLayoutTypes } from "@plane/constants";
import { EIssueLayoutTypes, ISSUE_DISPLAY_FILTERS_BY_PAGE } from "@plane/constants";
Copy link
Contributor

@coderabbitai coderabbitai bot Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Incomplete migration detected - old constant still in use
The migration from ISSUE_DISPLAY_FILTERS_BY_LAYOUT to ISSUE_DISPLAY_FILTERS_BY_PAGE is incomplete. The following files still use the old constant and need to be updated:

  • space/core/store/issue-filters.store.ts
  • space/core/components/issues/filters/root.tsx
  • packages/constants/src/issue/filter.ts
🔗 Analysis chain

Ensure references to the old layout constant are removed globally.
Switching from ISSUE_DISPLAY_FILTERS_BY_LAYOUT to ISSUE_DISPLAY_FILTERS_BY_PAGE is appropriate for consistency. Please verify that no references to the deprecated constant remain in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search the codebase for any leftover references to ISSUE_DISPLAY_FILTERS_BY_LAYOUT
rg "ISSUE_DISPLAY_FILTERS_BY_LAYOUT" 

Length of output: 640


Script:

#!/bin/bash
# Search for the new constant ISSUE_DISPLAY_FILTERS_BY_PAGE
rg "ISSUE_DISPLAY_FILTERS_BY_PAGE"

Length of output: 7441

Copy link
Collaborator Author

@mathalav55 mathalav55 Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai Layout-level filters are different from page-level filters. These are two different constants.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathalav55 I apologize for the confusion. Thank you for clarifying that layout-level filters and page-level filters serve different purposes and are meant to coexist as separate constants.


✏️ Learnings added
Learnt from: mathalav55
PR: makeplane/plane#6452
File: web/helpers/issue.helper.ts:6-6
Timestamp: 2025-01-24T09:37:19.129Z
Learning: In the Plane codebase, `ISSUE_DISPLAY_FILTERS_BY_LAYOUT` and `ISSUE_DISPLAY_FILTERS_BY_PAGE` are two distinct constants serving different purposes - one for layout-level filters and another for page-level filters. They are not interchangeable and should coexist.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment on lines 319 to 454
"cancel": "Cancelar",
"description": "Descripción",
"title": "Título",
"order_by": {
"label": "Ordenar por",
"manual": "Manual",
"last_created": "Último creado",
"last_updated": "Última actualización",
"start_date": "Fecha de inicio",
"due_date": "Fecha de vencimiento"
},
"comments": "Comentarios",
"updates": "Actualizaciones"
},
"form": {
"title": {
"required": "El título es obligatorio",
"max_length": "El título debe tener menos de {length} caracteres"
}
},
"entity": {
"grouping_title": "Agrupación de {entity}",
"priority": "{entity}",
"all": "Todos los {entity}",
"drop_here_to_move": "Suelte aquí para mover el {entity}"
},
"epic": {
"all": "Todas las épicas",
"label": "{count, plural, one {Épica} other {Épicas}}"
},
"issue": {
"label": "{count, plural, one {Problema} other {Problemas}}",
"all": "Todos los problemas",
"add": "Agregar problema",
"priority": {
"urgent": "Urgente",
"high": "Alta",
"medium": "Media",
"low": "Baja"
},
"display": {
"properties": {
"label": "Propiedades de visualización",
"id": "ID",
"issue_type": "Tipo de problema",
"sub_issue_count": "Cantidad de subproblemas",
"attachment_count": "Cantidad de archivos adjuntos"
},
"extra": {
"show_sub_issues": "Mostrar subproblemas",
"show_empty_groups": "Mostrar grupos vacíos"
}
},
"layouts": {
"ordered_by_label": "Este diseño está ordenado por",
"list": "Lista",
"kanban": "Tablero",
"calendar": "Calendario",
"spreadsheet": "Hoja de cálculo",
"gantt": "Línea de tiempo",
"title": {
"list": "Diseño de lista",
"kanban": "Diseño de tablero",
"calendar": "Diseño de calendario",
"spreadsheet": "Diseño de hoja de cálculo",
"gantt": "Diseño de línea de tiempo"
}
},
"states": {
"active": "Activo",
"backlog": "Pendientes"
},
"comments": {
"create": {
"success": "Comentario creado con éxito",
"error": "Error al crear el comentario. Por favor, inténtalo de nuevo más tarde."
},
"update": {
"success": "Comentario actualizado con éxito",
"error": "Error al actualizar el comentario. Por favor, inténtalo de nuevo más tarde."
},
"remove": {
"success": "Comentario eliminado con éxito",
"error": "Error al eliminar el comentario. Por favor, inténtalo de nuevo más tarde."
},
"upload": {
"error": "Error al subir el archivo. Por favor, inténtalo de nuevo más tarde."
}
}
},
"project": {
"label": "{count, plural, one {Proyecto} other {Proyectos}}"
},
"view": {
"create": {
"label": "Crear vista"
},
"update": {
"label": "Actualizar vista"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Maintain consistent formality in Spanish translations.

The translations mix formal and informal pronouns. Consider standardizing to informal "tú" form throughout:

    "common": {
-     "drop_here_to_move": "Suelte aquí para mover el {entity}",
+     "drop_here_to_move": "Suelta aquí para mover el {entity}",
      // ... other translations ...
    },
    "issue": {
      "comments": {
        "update": {
          "success": "Comentario actualizado con éxito",
-         "error": "Error al actualizar el comentario. Por favor, inténtalo de nuevo más tarde."
+         "error": "Error al actualizar el comentario. Por favor, inténtalo más tarde."
        }
      }
    }

Committable suggestion skipped: line range outside the PR's diff.

@mathalav55 mathalav55 marked this pull request as ready for review January 24, 2025 13:38
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: 3

🧹 Nitpick comments (4)
packages/constants/src/issue/common.ts (2)

32-43: Consider fixing naming inconsistency in the enum definition.

EIssueGroupByToServerOptions uses By whereas EIssueGroupBYServerToProperty uses BY. For clarity, rename one of these enums for consistent casing (e.g., EIssueGroupByServerToProperty).


113-121: Assess the maintainability of TCreateModalStoreTypes.

TCreateModalStoreTypes is a large union. If it continues to expand, consider converting it into an enum for better readability and usage consistency, especially in large-scale codebases.

packages/i18n/src/locales/es/translations.json (1)

319-368: Ensure translation keys use consistent casing.

Found "inbox": "bandeja de entrada". Check if other top-level keys match the target Spanish style (e.g., "Bandeja de entrada"). Consistency enhances readability across the UI.

web/core/components/inbox/inbox-filter/filters/priority.tsx (1)

37-37: Consider using translation pluralization for the count.

While the current implementation works, consider using a translation key that includes the count to better support languages with different pluralization rules.

-        title={`${t("common.priority")}${appliedFiltersCount > 0 ? ` (${appliedFiltersCount})` : ""}`}
+        title={t("common.priority_with_count", { count: appliedFiltersCount })}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d7309ed and 5dd2ecd.

📒 Files selected for processing (13)
  • packages/constants/src/issue/common.ts (1 hunks)
  • packages/i18n/src/locales/en/translations.json (1 hunks)
  • packages/i18n/src/locales/es/translations.json (1 hunks)
  • packages/types/src/issues.d.ts (1 hunks)
  • web/core/components/command-palette/actions/issue-actions/change-priority.tsx (3 hunks)
  • web/core/components/dropdowns/priority.tsx (10 hunks)
  • web/core/components/inbox/inbox-filter/applied-filters/priority.tsx (2 hunks)
  • web/core/components/inbox/inbox-filter/filters/priority.tsx (4 hunks)
  • web/core/components/issues/issue-layouts/filters/header/filters/priority.tsx (3 hunks)
  • web/core/components/issues/issue-layouts/kanban/default.tsx (2 hunks)
  • web/core/components/issues/issue-layouts/kanban/swimlanes.tsx (5 hunks)
  • web/core/components/issues/issue-layouts/list/list-group.tsx (5 hunks)
  • web/core/components/issues/issue-layouts/utils.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • web/core/components/command-palette/actions/issue-actions/change-priority.tsx
  • packages/types/src/issues.d.ts
  • web/core/components/issues/issue-layouts/filters/header/filters/priority.tsx
  • web/core/components/issues/issue-layouts/kanban/default.tsx
  • web/core/components/issues/issue-layouts/kanban/swimlanes.tsx
  • web/core/components/inbox/inbox-filter/applied-filters/priority.tsx
  • web/core/components/issues/issue-layouts/utils.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (15)
packages/constants/src/issue/common.ts (1)

78-102: Align ISSUE_PRIORITIES with TIssueFilterPriorityObject.

Currently, ISSUE_PRIORITIES omits fields (className and icon) that appear in TIssueFilterPriorityObject. Consider adding these fields or refactoring the type if they're not needed.

packages/i18n/src/locales/en/translations.json (2)

318-368: Check consistency of capitalization and usage in new “common” keys.

Most keys are capitalized properly (e.g., "All," "None"), but ensure consistency across UI surfaces (e.g., "All," "None," "No matches found").


381-407: Validate newly added “issue” priority translations.

The values under "issue.priority" match existing references to "urgent," "high," "medium," and "low." Ensure that these placeholders align with code usage and do not require suffixes like “_TITLE” or “_LABEL.”

packages/i18n/src/locales/es/translations.json (1)

379-379: Maintain consistent formality in Spanish translations.

Use "Suelta" (informal) throughout instead of mixing it with "Suelte" (formal). This suggestion is repeated from a previous review to unify pronoun usage.

web/core/components/dropdowns/priority.tsx (4)

8-8: LGTM! Good refactoring of constants.

Moving ISSUE_PRIORITIES to @plane/constants improves maintainability by centralizing issue-related constants.


206-208: LGTM! Good implementation of fallback chain.

The text content implementation with multiple fallbacks (title → translated priority → placeholder) provides good resilience while maintaining proper localization.


248-248: LGTM! Consistent implementation across components.

The TransparentButton component maintains consistency with other button variants while properly implementing translations.

Also applies to: 293-295


305-306: LGTM! Well-structured localization implementation.

The changes in the PriorityDropdown component:

  • Properly implement translations for the placeholder
  • Maintain consistency with button implementations
  • Improve code organization with clear section comments

Also applies to: 320-320, 359-359

web/core/components/inbox/inbox-filter/filters/priority.tsx (4)

5-6: LGTM! Clean import restructuring.

The imports are well-organized and align with the centralization of constants.


22-22: LGTM! Proper translation hook setup.

The useTranslation hook is correctly implemented at the component level.


54-54: LGTM! Proper translation of the no matches message.

The "no matches found" message is correctly internationalized.


Line range hint 22-54: Verify translation key existence.

Let's ensure all translation keys used in this component exist in the translation files.

✅ Verification successful

Translation keys are properly implemented.

The translation keys "common.priority" and "common.no_matches_found" exist in the translations file and are correctly structured within the "common" namespace. The implementation follows the established patterns in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if all translation keys exist in translation files

# Look for translation files
echo "Searching for translation files..."
fd -e json -p "locales/" | while read -r file; do
  echo "Checking $file for required keys..."
  for key in "common.priority" "common.no_matches_found"; do
    if ! jq -e ".. | objects | select(has(\"$key\"))" "$file" > /dev/null; then
      echo "Warning: Key '$key' not found in $file"
    fi
  done
done

Length of output: 4722


Script:

#!/bin/bash
# Check the structure of translation files and look for similar keys
echo "Examining English translations file structure:"
jq '.' packages/i18n/src/locales/en/translations.json

echo -e "\nSearching for keys containing 'priority':"
jq 'paths | select(.[]) | map(tostring) | join(".")' packages/i18n/src/locales/en/translations.json | grep -i priority || echo "No 'priority' keys found"

echo -e "\nSearching for keys containing 'matches':"
jq 'paths | select(.[]) | map(tostring) | join(".")' packages/i18n/src/locales/en/translations.json | grep -i matches || echo "No 'matches' keys found"

Length of output: 21342

web/core/components/issues/issue-layouts/list/list-group.tsx (3)

8-10: LGTM! Clean import organization.

The new imports are well-organized and properly sectioned with comments.


104-104: LGTM! Proper hook initialization.

The useTranslation hook is correctly initialized at the component level, following React hooks best practices.


214-219: Consider enhancing error handling and verify translation.

  1. The warning toast implementation looks good, but consider translating the dropErrorMessage as well since it might contain user-facing text.
  2. Verify that the common.warning translation key exists in all supported language files.
✅ Verification successful

The warning toast implementation is correct as is.

  1. The common.warning translation key is properly implemented and available in all supported languages.
  2. The dropErrorMessage is intentionally not translated as it contains dynamically generated messages with contextual information (e.g., "Issue cannot be moved to completed cycles").
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the translation key in language files

# Search for the translation key in language files
rg -g '*.json' '"common\.warning"' web/public/locales/

Length of output: 116


Script:

#!/bin/bash
# Find translation files and check their content
echo "=== Looking for translation files ==="
fd -e json

echo -e "\n=== Checking for translation patterns ==="
rg -g '*.json' '"common":'

echo -e "\n=== Checking translation usage patterns ==="
rg "import.*useTranslation.*from" -A 2

Length of output: 29726


Script:

#!/bin/bash
# Check for common.warning in translation files and error message patterns
echo "=== Checking common.warning in translation files ==="
rg '"warning"' packages/i18n/src/locales/

echo -e "\n=== Analyzing error message handling patterns ==="
rg "dropErrorMessage" -B 2 -A 2

Length of output: 9691

@@ -77,7 +76,7 @@ const BorderButton = (props: ButtonProps) => {
return (
<Tooltip
tooltipHeading={t("priority")}
tooltipContent={t(priorityDetails?.key ?? "none")}
tooltipContent={priorityDetails?.title ?? "None"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add translation for the fallback text.

The tooltip content uses the untranslated string "None" as fallback. For consistency with the localization strategy, use the translation key.

-      tooltipContent={priorityDetails?.title ?? "None"}
+      tooltipContent={priorityDetails?.title ?? t("common.none")}

Committable suggestion skipped: line range outside the PR's diff.

@@ -263,7 +263,7 @@ export const ListGroup = observer((props: Props) => {
groupID={group.id}
groupBy={group_by}
icon={group.icon}
title={group.name || ""}
title={group.name}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Maintain fallback for group title.

The removal of the empty string fallback (|| "") could lead to rendering issues if group.name is undefined. Consider maintaining the fallback or using a null coalescing operator.

-          title={group.name}
+          title={group.name ?? ""}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
title={group.name}
title={group.name ?? ""}

@@ -132,7 +132,7 @@
}
onClick={() => loadMoreIssues(group.id)}
>
Load More &darr;
{t("common.load_more")} &darr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Missing translation key 'common.load_more'

The translation key common.load_more is not present in any of the translation files. This key needs to be added to all language files:

  • packages/i18n/src/locales/en/translations.json
  • packages/i18n/src/locales/es/translations.json
  • packages/i18n/src/locales/fr/translations.json
  • packages/i18n/src/locales/ja/translations.json
  • packages/i18n/src/locales/zh-CN/translations.json
🔗 Analysis chain

Verify translation key exists.

The hardcoded text has been replaced with a translation key. Please ensure that the common.load_more translation key exists in all supported language files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the translation key in language files

# Search for the translation key in language files
rg -g '*.json' '"common\.load_more"' web/public/locales/

Length of output: 118


Script:

#!/bin/bash
# First, let's find potential translation files
fd -e json . | grep -i "locale\|translation\|lang"

# If we find files, we'll search for the translation key

Length of output: 290


Script:

#!/bin/bash
# Search for the translation key in all translation files
rg -A 1 '"common\.load_more"' packages/i18n/src/locales/*/translations.json

Length of output: 269

@mathalav55 mathalav55 marked this pull request as draft January 24, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟enhancement New feature or request 🌐frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant