Bugfix FXIOS-15303 [Translations Phase 2] Translation button doesn't appear when the primary device language isn't supported but a fallback language is#32861
Merged
Conversation
💪 Quality guardian4 tests files modified. You're a champion of test coverage! 🚀 🥇 Perfect PR sizeSmaller PRs are easier to review. Thanks for making life easy for reviewers! ✨ ✅ New file code coverageNo new file detected so code coverage gate wasn't ran. Client.app: Coverage: 39.45
Generated by 🚫 Danger Swift against f3fd3b7 |
…but a preferred fallback does When the translationLanguagePicker flag is enabled, shouldOfferTranslation now checks each preferred language in order and returns true on the first available model pair, instead of only checking the primary device language. The middleware builds the language list from the flag: a single device language when the flag is OFF (no behavior change), or the full ordered preferred list from PreferredTranslationLanguagesManager when ON.
821b588 to
7387b22
Compare
| /// When OFF, returns only the primary device language (preserving legacy behavior). | ||
| private func targetLanguagesForEligibilityCheck() async -> [String] { | ||
| if featureFlags.isFeatureEnabled(.translationLanguagePicker, checking: .buildOnly) { | ||
| let manager = PreferredTranslationLanguagesManager(prefs: profile.prefs) |
Collaborator
There was a problem hiding this comment.
should we inject this to in order to east tests as well ?
| let supported = await translationsService.fetchSupportedTargetLanguages() | ||
| return manager.preferredLanguages(supportedTargetLanguages: supported) | ||
| } | ||
| return [Locale.current.languageCode].compactMap { $0 } |
Collaborator
There was a problem hiding this comment.
we should use the SystemLocaleProvider here. we can inject it in the middleware
Collaborator
Author
There was a problem hiding this comment.
Good point, updated
…ranslationsMiddleware
FilippoZazzeroni
approved these changes
Apr 8, 2026
Contributor
|
🚀 PR merged to |
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.
📜 Tickets
Jira ticket
Github issue
💡 Description
When the translationLanguagePicker flag is ON, the translation button now checks all of the user's preferred languages against the current page, not just the primary device language. The button appears as soon as any preferred language has an available translation model for the page.
🎥 Demos
Demo
📝 Checklist