Repository navigation
feat(sync): show the Quran ID sign-in page in the app's language - #1315
Merged
Merged
Conversation
Sign-in now sends the language the app's strings resolved to (Locale.preferredLanguageLocale, which honors a per-app language) as the OIDC ui_locales, so an app in Arabic on an English phone gets the sign-in page in Arabic instead of the browser's language. Languages the page doesn't support fall back to Accept-Language as before. Needs a mobile-sync-spm release with login(uiLocales:). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mobile-sync-spm 0.4.16 (quran/mobile-sync-spm#54) adds MobileSyncAuthService.login(uiLocales:) on mobile-sync 0.1.60 (quran/mobile-sync#397), which sign-in now calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Signing in to Quran.com opened the Quran ID page in the phone's language, not the app's. So an app set to Arabic through iOS's per-app language, on an English phone, got an English sign-in page. Sign-in now sends the language the app's strings resolved to as the OIDC
ui_locales, and the page shows in Arabic. A language the page doesn't support yet falls back to the browser's language, as before.Change
AuthenticationClientMobileSyncImpl.login(on:)passes[Locale.preferredLanguageLocale.languageCode]toMobileSyncAuthService.login(uiLocales:).preferredLanguageLocalefollowsBundle.fixedModule.preferredLocalizations, which honors a per-app language.AuthenticationClientnow depends onLocalization.Dependencies
This PR moves
mobile-sync-spmto 0.4.16 (quran/mobile-sync-spm#54, released on mobile-sync 0.1.60 from quran/mobile-sync#397), which addslogin(uiLocales:).Package.resolveddoesn't change, because it keeps no sync-only pins.Tests
No new test: the locale only appears in the browser request inside MobileSync, and testing it here would mean faking MobileSync's auth service.
PreferredLanguageLocaleTestsalready covers how the locale is chosen.make build-sync-local-debugandmake test-sync-local-debug TARGET=AuthenticationClientTestswith the local mobile-sync and mobile-sync-spm branches.make test-sync TARGET=AuthenticationClientTestsagainst the released mobile-sync-spm 0.4.16: 6 tests, 0 failures.make build-no-syncandmake format-lint.The system's "Wants to Use … to Sign In" alert stays in the phone's language; iOS draws it.
🤖 Generated with Claude Code