[T3339] FIX: gate B2S letter translation on detected content language - #2120
Merged
Conversation
Danielgergely
commented
Jul 28, 2026
Member
- FIX: Trust the letter's detected language over the field-office stamp; fail safe to translation when it can't be determined
- FIX: Trust the letter's detected language over the field-office stamp; fail safe to translation when it can't be determined
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Confidence Score: 5/5The PR appears safe to merge, with undetectable content consistently falling back to translation or manual handling. The new helper uses the most processed available letter text, while both callers explicitly reject an empty detection result. Files Needing Attention: Module dependencies guarantee the helper is available, and no incompatible consumers or overrides were identified.
What T-Rex did
|
| Filename | Overview |
|---|---|
| partner_communication_compassion/models/correspondence.py | Replaces metadata-based auto-send eligibility with a fail-safe detected-content-language check. |
| sbc_compassion/models/correspondence.py | Adds the shared content normalization and language-detection helper used by both gates. |
| sbc_translation/models/correspondence.py | Uses detected content language to decide whether a letter can bypass translation. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Select translated, English, or original text] --> B[Normalize text and detect language]
B --> C{Language detected and supported?}
C -->|Yes| D[Continue publication or auto-send]
C -->|No| E[Route to translation or manual delivery]
Reviews (1): Last reviewed commit: "[T3339] FIX: gate B2S letter translation..." | Re-trigger Greptile
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.