-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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-3173] chore: language support for cycles constant file #6415
base: preview
Are you sure you want to change the base?
Conversation
Pull Request Linked with Plane Issues Comment Automatically Generated by Plane |
Warning Rate limit exceeded@gakshita has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 47 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
WalkthroughThis pull request focuses on enhancing the localization of cycle-related constants and components. The changes involve removing the Changes
Sequence DiagramsequenceDiagram
participant Constants as Cycle Constants
participant Locales as Translation Files
participant Component as React Components
Constants->>Locales: Define Localization Keys
Locales-->>Component: Provide Translations
Component->>Component: Use Translation Hook
Component-->>User: Render Localized Text
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
packages/constants/src/cycle.ts (1)
Line range hint
1-42
: Consider adding type safety for translation keysTo prevent typos and ensure type safety, consider defining an interface or type for the translation keys.
interface CycleTranslationKeys { label: keyof typeof translations.project_cycles.status; title: keyof typeof translations.project_cycles.status; // ... other properties } export const CYCLE_STATUS: CycleTranslationKeys[] = [ // ... existing array ];web/core/components/cycles/applied-filters/status.tsx (1)
30-30
: Simplify the conditional renderingThe optional chaining is redundant since we're already checking for
statusDetails
in the condition.- {statusDetails && t(statusDetails?.title)} + {statusDetails && t(statusDetails.title)}web/core/components/cycles/dropdowns/filters/status.tsx (2)
9-10
: Remove empty comments sectionThe commented line "// types" followed by "// constants" appears to be unused and can be removed.
- // types - // constants
21-22
: Improve comment formattingThe comment formatting is inconsistent. Consider using a single line for the hooks section.
- //hooks - const { t } = useTranslation(); + // hooks + const { t } = useTranslation();
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
packages/constants/src/cycle.ts
(1 hunks)packages/constants/src/index.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)web/core/components/cycles/analytics-sidebar/sidebar-header.tsx
(3 hunks)web/core/components/cycles/applied-filters/status.tsx
(3 hunks)web/core/components/cycles/dropdowns/filters/status.tsx
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (9)
packages/constants/src/index.ts (1)
17-17
: LGTM! Export follows consistent patternThe new cycle export follows the existing barrel file pattern and maintains alphabetical ordering.
packages/constants/src/cycle.ts (1)
11-13
: Verify translation keys exist in all language filesThe status labels and titles now use translation keys. Please ensure these keys exist in all language files:
- project_cycles.status.days_left
- project_cycles.status.in_progress
- project_cycles.status.yet_to_start
- project_cycles.status.completed
- project_cycles.status.draft
Also applies to: 19-21, 27-29, 35-37
✅ Verification successful
All translation keys are properly configured
All required translation keys exist and are properly translated in English, Spanish, French, and Japanese locales.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if all required translation keys exist in all language files for key in "days_left" "in_progress" "yet_to_start" "completed" "draft"; do echo "Checking key: project_cycles.status.$key" for locale in en es fr ja; do if [ -f "packages/i18n/src/locales/$locale/translations.json" ]; then echo "In $locale:" jq ".project_cycles.status.$key" "packages/i18n/src/locales/$locale/translations.json" fi done doneLength of output: 5024
web/core/components/cycles/applied-filters/status.tsx (1)
3-4
: LGTM! Import changes align with package structureThe imports have been correctly updated to use the new package-based constants and i18n hook.
web/core/components/cycles/dropdowns/filters/status.tsx (1)
3-4
: LGTM! Import changes match other componentsThe imports have been correctly updated to use the package-based constants and i18n hook, maintaining consistency with other components.
web/core/components/cycles/analytics-sidebar/sidebar-header.tsx (1)
8-9
: LGTM! Proper implementation of i18n support.The changes correctly implement internationalization by:
- Importing required dependencies from @plane/constants and @plane/i18n
- Using the translation hook to render the cycle title
Also applies to: 288-288
packages/i18n/src/locales/en/translations.json (1)
321-329
: LGTM! Well-structured translations for cycle status.The English translations are clear, consistent, and follow i18n best practices.
packages/i18n/src/locales/ja/translations.json (1)
321-329
: LGTM! Consistent Japanese translations for cycle status.The Japanese translations maintain structural consistency with other language files while providing culturally appropriate translations.
packages/i18n/src/locales/es/translations.json (1)
321-329
: LGTM! Well-localized Spanish translations for cycle status.The Spanish translations maintain consistency with other language files while providing grammatically correct and culturally appropriate translations.
packages/i18n/src/locales/fr/translations.json (1)
319-328
: LGTM! French translations are accurate and well-structured.The translations for project cycle statuses are grammatically correct and maintain proper French language conventions. The hierarchical structure with the parent key "project_cycles" is also well-organized.
"project_cycles": { | ||
"status": { | ||
"days_left": "Días restantes", | ||
"completed": "Completado", | ||
"yet_to_start": "Por comenzar", | ||
"in_progress": "En progreso", | ||
"draft": "Borrador" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Missing required translations in Chinese locale file
The project_cycles.status
section is completely missing in packages/i18n/src/locales/zh-CN/translations.json
. Please add the following structure with appropriate Chinese translations:
project_cycles.status.days_left
project_cycles.status.completed
project_cycles.status.yet_to_start
project_cycles.status.in_progress
project_cycles.status.draft
🔗 Analysis chain
Verify translation key consistency across language files.
Let's ensure all required translation keys are present in all language files.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for consistency of project_cycles.status keys across language files
# List all translation files
translation_files=$(fd translations.json packages/i18n/src/locales)
# Check for required keys in each file
for file in $translation_files; do
echo "Checking $file..."
jq -e '.project_cycles.status | has("days_left") and has("completed") and has("yet_to_start") and has("in_progress") and has("draft")' "$file"
done
Length of output: 2064
Script:
#!/bin/bash
# Show the actual content of project_cycles.status in zh-CN translations
echo "Content of zh-CN translations:"
jq '.project_cycles.status' packages/i18n/src/locales/zh-CN/translations.json
Length of output: 153
Script:
#!/bin/bash
# Check if project_cycles exists and show its structure
echo "Structure of project_cycles in zh-CN:"
jq '.project_cycles' packages/i18n/src/locales/zh-CN/translations.json
Length of output: 160
Summary
This PR moved the Cycles constants file to package and resolved title based on language selected
Summary by CodeRabbit
Localization
Constants
CYCLE_TABS_LIST
constant