Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Jul 9, 2025

Description

This PR fixes an issue where raw translation keys and untranslated error messages were being displayed in the UI for embedding provider validation errors.

The _initializeEmbedder() method in src/services/code-index/manager.ts now wraps error messages with the t() translation function. This ensures that:

  • If a translation exists for an error key, it is used.
  • If no translation is found, the original error message is displayed as a fallback.

This provides a better user experience by showing properly localized error messages.

Changes

  • Modified src/services/code-index/manager.ts to translate error messages by:
    • Importing the t() function from the i18n module
    • Wrapping validation error messages with t() before setting system state and throwing errors
    • Implementing fallback logic to use original message if translation returns an invalid result

Testing

  • The change ensures that error messages are properly translated when displayed in the UI
  • Falls back gracefully to original error messages when translations are not available
  • Maintains existing error handling behavior while improving localization

Important

Translates error messages in manager.ts using t() function, improving localization and user experience.

  • Behavior:
    • Translates error messages in _initializeEmbedder() in manager.ts using t() function.
    • Uses original error message if translation is not found or invalid.
  • Imports:
    • Adds import { t } from "../../i18n" in manager.ts.
  • Error Handling:
    • Sets system state and throws errors with translated messages in manager.ts.

This description was created by Ellipsis for 3eb596b. You can customize this summary. It will automatically update as commits are pushed.

- Import t() function from i18n module
- Wrap error messages with t() translation function in _initializeEmbedder()
- Ensures proper localization of error messages in the UI
- Falls back to original message if no translation exists
@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners July 9, 2025 23:13
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working UI/UX UI/UX related or focused labels Jul 9, 2025
@delve-auditor
Copy link

delve-auditor bot commented Jul 9, 2025

No security or compliance issues detected. Reviewed everything up to 3eb596b.

Security Overview
  • 🔎 Scanned files: 1 changed file(s)
Detected Code Changes
Change Type Relevant files
Refactor ► open-file.ts
    Simplify file path handling logic
► manager.ts
    Add error message translation support

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 9, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 9, 2025
@mrubens mrubens merged commit 45f3d88 into main Jul 9, 2025
29 checks passed
@mrubens mrubens deleted the fix/translate-embedder-error-messages branch July 9, 2025 23:22
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 9, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants