-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: internationalize hardcoded strings in Jina embedder #6419
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
Conversation
- Add Jina to EmbedderProvider type and model profiles - Implement JinaEmbedder class with multi-vector embeddings support - Configure jina-embeddings-v4 model with code.query downstream task - Add UI components for Jina provider selection and API key input - Include proper error handling and rate limiting - Add localization support for Jina-related messages
- Replace hardcoded "Base64/binary embeddings are not supported" with t("embeddings:unsupportedEmbeddingFormat")
- Replace hardcoded "Unknown error" with t("embeddings:unknownError")
- Add "unsupportedEmbeddingFormat" translation key to all supported languages
- Add missing "jinaConfigMissing" translation key to backend embeddings.json files
This fixes hardcoded strings that were found during translation review of the Jina embedder implementation.
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.
Code Review Summary
This PR successfully internationalizes hardcoded strings in the Jina embedder and adds comprehensive Jina provider support. The implementation follows established patterns and maintains consistency with other embedding providers.
Critical Issues (Must Fix)
1. Missing jinaConfigMissing translation in Catalan
- File: src/i18n/locales/ca/embeddings.json
- The Catalan translation file is missing the
jinaConfigMissingkey that was added to German and English files - This will cause runtime errors when using Catalan locale with Jina provider
2. Incomplete Jina API key handling in UI secret status
- File: webview-ui/src/components/chat/CodeIndexPopover.tsx (lines 288-335)
- The secret status handler doesn't update
codebaseIndexJinaApiKeyfield when receiving secret status updates - Other providers (OpenAI, Gemini, Mistral) properly handle their API key placeholders, but Jina is missing
Important Suggestions (Should Consider)
3. Inconsistent translation key placement
- The new
unsupportedEmbeddingFormatkey appears at different line positions across language files - Consider maintaining consistent ordering for better maintainability
4. Enhanced error handling specificity
- File: src/services/code-index/embedders/jina.ts (lines 264-268)
- Could provide more specific error messages for different HTTP status codes beyond 401 and 429
Minor Improvements (Nice to Have)
5. Documentation consistency
- Consider adding JSDoc comments to JinaEmbedder class methods for consistency with other embedder implementations
6. Translation validation
- Verify all 17 supported languages have consistent translation keys and proper formatting
Positive Aspects
✅ Proper internationalization implementation using t() function calls
✅ Consistent integration with existing embedding provider patterns
✅ Comprehensive UI integration with validation and error handling
✅ Well-structured JinaEmbedder class with proper batching and rate limiting
✅ Appropriate model profiles and default configurations
✅ Clean type definitions and schema updates
The core functionality is solid and follows established patterns well. The critical issues should be addressed before merging to ensure proper functionality across all supported locales.
- Added jinaConfigMissing translation to 14 backend embeddings.json files - Added Jina UI translations (provider, API key label/placeholder, validation) to Catalan frontend - All backend translations now complete for Jina embedder - Partial progress on frontend translations (Catalan complete, 16 languages remaining)
- Added Jina provider translations for 6 languages (ca, de, es, fr, ko, tr) - Added validation translations for all 16 languages - Partially completed remaining 10 languages (missing provider section keys) - All hardcoded strings in Jina embedder properly use i18n functions - Translation check script confirms backend translations are complete
This PR fixes hardcoded strings found during translation review of the Jina embedder implementation in PR #6416.
Issues Fixed
Hardcoded Strings in Jina Embedder
"Base64/binary embeddings are not supported"→t("embeddings:unsupportedEmbeddingFormat")"Unknown error"→t("embeddings:unknownError")Changes Made
1. Fixed Hardcoded Strings
unknownErrortranslation key where availableunsupportedEmbeddingFormattranslation key2. Added Missing Translations
unsupportedEmbeddingFormattranslation to all 17 supported languages:jinaConfigMissingtranslation to backend embeddings.json filesTranslation Coverage
Related
Testing
Remaining Work
The translation check script still reports missing translations for:
This PR focuses specifically on fixing the hardcoded strings found in the Jina embedder implementation.
Important
Internationalized hardcoded strings in Jina embedder and added support for Jina as an embedder provider with translations and configuration updates.
jina.ts.unsupportedEmbeddingFormatandunknownErrortranslation keys.unsupportedEmbeddingFormatin 17 languages.codebase-index.ts,config-manager.ts, andservice-factory.ts.JinaEmbedderclass injina.tsfor embedding operations.webviewMessageHandler.tsto handle Jina API key storage.CodeIndexPopover.tsxto include Jina provider options.global-settings.ts.This description was created by
for 612dd65. You can customize this summary. It will automatically update as commits are pushed.