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

added translation keys #709

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

added translation keys #709

wants to merge 2 commits into from

Conversation

elisadinsmore
Copy link

Please explain how to summarize this PR for the Changelog:

Added translation keys for localization

Tell code reviewer how and what to test:

Ensure that the correct English translations are still showing once the accompanying PR to the translations file is live.

@elisadinsmore elisadinsmore changed the title added keys added translation keys Nov 21, 2024
Copy link
Contributor

coderabbitai bot commented Nov 21, 2024

Walkthrough

The changes in this pull request involve modifications to the viewMappedPlugin function within the view-mapped.ts file. The updates consist of replacing longer descriptive messages with concise identifiers prefixed by plugins.viewMapped. in several tick function calls and the final outcome message. Additionally, the error message in the catch block has been updated to follow the same concise format.

Changes

File Change Summary
plugins/view-mapped/src/view-mapped.ts Updated messages in the viewMappedPlugin function: replaced descriptive strings with concise identifiers prefixed by plugins.viewMapped. for multiple tick calls and the final outcome message.

Possibly related PRs


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 803e190 and 2f13865.

📒 Files selected for processing (1)
  • plugins/view-mapped/src/view-mapped.ts (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/view-mapped/src/view-mapped.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 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.

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

🧹 Outside diff range and nitpick comments (2)
plugins/view-mapped/src/view-mapped.ts (2)

40-40: Consider using distinct translation keys for different progress stages.

The same translation key 'viewMapped.updatingTable' is used at two different progress points (10% and 30%). This might be confusing for translators and users. Consider using distinct keys to allow for more specific progress messages.

- await tick(10, 'viewMapped.updatingTable')
+ await tick(10, 'viewMapped.startingUpdate')

- await tick(30, 'viewMapped.updatingTable')
+ await tick(30, 'viewMapped.processingFields')

Also applies to: 62-62


Line range hint 124-131: Consider enhancing error message handling.

While the error is logged internally, the user-facing error message 'viewMapped.error' is very generic. Consider:

  1. Adding more specific error keys based on the type of error
  2. Including relevant troubleshooting information in the translation
- throw new Error('viewMapped.error')
+ // Determine error type and throw appropriate message
+ const errorKey = error.name === 'ValidationError' 
+   ? 'viewMapped.error.validation'
+   : 'viewMapped.error.general';
+ throw new Error(errorKey)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between c4be770 and 803e190.

📒 Files selected for processing (1)
  • plugins/view-mapped/src/view-mapped.ts (6 hunks)
🔇 Additional comments (1)
plugins/view-mapped/src/view-mapped.ts (1)

119-122: LGTM! Completion message key is well-structured.

The translation key follows the established pattern and is appropriately placed in the completion handler.

@@ -37,7 +37,7 @@ export function viewMappedPlugin() {

try {
// First, we acknowledge the job
await tick(10, 'Updating the table to only view mapped fields')
await tick(10, 'viewMapped.updatingTable')
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 keys detected - action required

The translation keys used in view-mapped.ts are not defined in any of the translation files. Please add the following translation keys:

  • viewMapped.updatingTable
  • viewMapped.halfway
  • viewMapped.almostDone
  • viewMapped.complete
  • viewMapped.error
🔗 Analysis chain

Verify translation keys are defined in translation files.

Let's ensure all new translation keys are properly defined in the corresponding translation files.

Also applies to: 62-62, 85-85, 105-105, 119-119, 130-130

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for translation key definitions
echo "Searching for translation key definitions..."
keys=(
    "viewMapped.updatingTable"
    "viewMapped.halfway"
    "viewMapped.almostDone"
    "viewMapped.complete"
    "viewMapped.error"
)

# Look for translation files and check for these keys
fd -e json -e yaml -e yml | while read -r file; do
    echo "Checking file: $file"
    for key in "${keys[@]}"; do
        if rg -q "$key" "$file"; then
            echo "✓ Found key: $key"
        else
            echo "⚠ Missing key: $key"
        fi
    done
done

Length of output: 65573

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