feature: Implement Glossaries for Firestore Translate Text Extension #2254
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.
Overview
This pull request introduces support for glossaries in the Firestore Translate Text Extension. The feature allows for domain-specific translations, ensuring certain terms remain unaltered during translation or are translated as defined in a glossary. The implementation addresses the need for unmutable names, enhancing translation accuracy and flexibility.
Changes Made
1. Glossary Integration
GLOSSARY_ID
: Allows users to specify the ID of a glossary.SOURCE_LANGUAGE_CODE
: Required when using a glossary to define the source language.2. Extension Configuration Updates
extension.yaml
to:GLOSSARY_ID
,SOURCE_LANGUAGE_CODE
, andGOOGLE_APPLICATION_CREDENTIALS
parameters.GOOGLE_APPLICATION_CREDENTIALS
astype: secret
for enhanced security.3. Codebase Enhancements
4. Testing
mocks
to handle glossary-related scenarios, including errors and edge cases.5. Documentation
README.md
,PREINSTALL.md
, andPOSTINSTALL.md
to:Manual Testing
Performed manual testing on a separate example app:
Additional Notes
Thank you for reviewing this pull request. Please feel free to provide feedback or suggest further enhancements.
fixes: #2099