-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(i18n): Correct translation fallback logic for embedding errors #5574
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
✅ No security or compliance issues detected. Reviewed everything up to 63ebdf3. Security Overview
Detected Code Changes
Reply to this PR with |
mrubens
approved these changes
Jul 10, 2025
1f71af1 to
6c5b36d
Compare
… translation keys - Remove complex fallback logic from manager.ts since errors should be translated at source - Update tests to expect translation keys as returned by t() function in test environment - This ensures consistent behavior between test and production environments
…nts in embedder services
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Member
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
lgtm
This PR has been approved by a maintainer
PR - Needs Review
size:L
This PR changes 100-499 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


Closes #5572
Problem
When validating embedder configurations, if an error occurs and its corresponding translation key is not found, the system was incorrectly displaying the raw translation key (e.g., "embeddings:validation.configurationError") to the user. This was caused by flawed fallback logic in
src/services/code-index/manager.ts.Solution
This PR corrects the translation fallback logic. The code now checks if the
i18nexttranslation function returns the original key. If it does, it correctly uses the original error message as a fallback, ensuring a meaningful error message is always displayed to the user.Important
Fixes translation fallback logic for embedding errors and updates related translations and tests.
manager.tsto use original error message if translation key is not found.apiKeyRequiredandbaseUrlRequiredinembeddings.jsonfor multiple languages.gemini.spec.tsandopenai-compatible.spec.tsto expect new error messagesvalidation.apiKeyRequiredandvalidation.baseUrlRequired.validation-helpers.tsto uset()for error messages.This description was created by
for 937e40b. You can customize this summary. It will automatically update as commits are pushed.