Skip to content

fix: update localization keys for common, risk, and settings - #171

Merged
claudfuen merged 6 commits into
mainfrom
claudio/misc-fixes-2
Mar 21, 2025
Merged

claudfuen merged 6 commits into
mainfrom
claudio/misc-fixes-2

Conversation

@claudfuen

@claudfuen claudfuen commented Mar 21, 2025 •

Copy link
Copy Markdown
Contributor
  • Added new localization keys for frequency options (monthly, quarterly, yearly) in common.
  • Introduced new keys for risk department and its placeholder in the risk feature.
  • Added a delete confirmation message in settings and a new home navigation message in the error handling section.

Summary by CodeRabbit

  • New Features
    • Introduced new localized status values (assessed, active, inactive) and frequency intervals (monthly, quarterly, yearly).
    • Expanded localized labels for risk management actions and descriptions.
    • Added a deletion confirmation prompt and improved messaging for invitation error situations.
    • Added a new message for switching organizations during onboarding.
    • Enhanced status categorization for team members (accepted, pending) and policy statuses (relevant, not relevant).
    • Centralized translation logic for status types in the StatusPolicies component.
    • Introduced new constants for excluded translation keys to streamline unused key checks.

- Added new localization keys for frequency options (monthly, quarterly, yearly) in common.
- Introduced new keys for risk department and its placeholder in the risk feature.
- Added a delete confirmation message in settings and a new home navigation message in the error handling section.
@vercel

vercel Bot commented Mar 21, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 21, 2025 7:42pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
comp-portal ⬜️ Skipped (Inspect) Mar 21, 2025 7:42pm

@CLAassistant

CLAassistant commented Mar 21, 2025 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Mar 21, 2025 •

Copy link
Copy Markdown

Walkthrough

This pull request updates localization files by adding new keys to existing objects. In the common localization file, several new status values (assessed, active, inactive) and a frequency object with monthly, quarterly, and yearly keys are introduced. The risk localization file now includes multiple new entries related to risk management actions and descriptions. The settings file gains additional confirmation strings, status categorization for team members, and error navigation strings. Additionally, a new constant for excluding certain translation keys is introduced. These changes enhance the application's localization coverage without modifying existing properties or functionality.

Changes

File(s) Change Summary
apps/.../locales/core/common.ts Added new status values: assessed, active, inactive, and a frequency object with keys: monthly, quarterly, and yearly.
apps/.../locales/features/risk.ts Introduced new entries for risk management: update_inherent_risk, update_inherent_risk_description, update_residual_risk, update_residual_risk_description, update_risk, update_risk_description, risk_department, risk_department_placeholder, no_risks, inherent_risk_description, residual_risk_description, inherentRisk, residualRisk, attachments, and sheet.
apps/.../locales/settings/settings.ts Added delete_confirm in the settings object, a new status object with keys accepted and pending, and a home key in the invitations.error section.
apps/.../locales/analyze-locale-usage.ts Added constant EXCLUDE_KEYS to skip certain translation keys during unused key checks.
apps/.../locales/auth/onboarding.ts Added new key switch with value "Switching organization..." in the onboarding object.
apps/.../components/status-policies.tsx Introduced new function getStatusTranslation for mapping status types to translation keys, modifying rendering logic in StatusPolicies component.
apps/.../locales/features/policies.ts Added new entries to the status object: relevant with value "Relevant" and "not-relevant" with value "Not Relevant".

Poem

I'm a jolly rabbit, hopping with delight,
New words abound, making everything feel right.
Statuses and frequencies now hop in a row,
With risk and settings, our messages grow.
With a twitch of my nose, I cheer these changes so bright!
🐇🌟


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4aa65ff and 97603da.

📒 Files selected for processing (1)
  • apps/app/src/locales/en.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/app/src/locales/en.ts

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai 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.

- Added new localization keys for onboarding, common statuses, and risk descriptions to improve clarity and consistency.
- Introduced keys for excluded translation checks to streamline unused key detection.
- Updated existing keys in the risk and settings modules to enhance user experience and provide better context.
@vercel
vercel Bot temporarily deployed to Preview – comp-portal March 21, 2025 19:29 Inactive
- Added new translation keys for relevant and not-relevant statuses in the policies localization.
- Implemented a mapping function for status translations to improve clarity in the StatusPolicies component.
- Updated the unused key detection logic to support wildcard patterns for better flexibility in excluding keys.
@vercel
vercel Bot temporarily deployed to Preview – comp-portal March 21, 2025 19:32 Inactive
- Added 'common.status.*' to the list of excluded keys for unused localization checks.
- Enhanced flexibility in detecting unused translation keys by supporting wildcard patterns.
@vercel
vercel Bot temporarily deployed to Preview – comp-portal March 21, 2025 19:33 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/app/src/locales/analyze-locale-usage.ts (1)

128-141: Good implementation of wildcard pattern matching!

The implementation correctly handles the exclusion of keys using wildcard patterns ending with *. This is a clean approach that makes the tool more flexible when analyzing localization usage.

Consider adding a brief comment explaining what types of keys these specific patterns (common.frequency.* and common.status.*) represent, which would help with future maintenance.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1fd3869 and def0dfc.

📒 Files selected for processing (1)
  • apps/app/src/locales/analyze-locale-usage.ts (2 hunks)
🔇 Additional comments (1)
apps/app/src/locales/analyze-locale-usage.ts (1)

19-24: Well-implemented exclusion mechanism for localization keys!

This is a good addition that allows certain translation key patterns to be excluded from the unused key check. The exclusion is particularly useful for dynamic keys or those that might be used programmatically in ways that static analysis can't detect.

- Changed the export type of translations from DeepReadonly to Readonly for improved type consistency across the application.
@vercel
vercel Bot temporarily deployed to Preview – comp-portal March 21, 2025 19:34 Inactive
- Changed the export of translations from a constant to a named export for improved modularity and consistency in localization handling.

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – app — 97603da3 Deployed Mar 21, 2025 by vercel[bot]
Preview – comp-portal — 97603da3 Deployed Mar 21, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants