feat: support runtime locale changes in hooks and compat - #232
Merged
Merged
Conversation
Expose Superwall.shared.localeIdentifier as a runtime-settable property across iOS, Android, TypeScript module, Zustand store, and compat layer. This allows changing the paywall language at runtime without needing to reconfigure the SDK. Previously, localeIdentifier could only be set via SuperwallOptions at configure time, making dynamic language switching impossible. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> (cherry picked from commit f330f57)
Xget7
marked this pull request as draft
September 14, 2026 10:55
commit: |
Xget7
marked this pull request as ready for review
September 14, 2026 22:20
Contributor
|
Thanks for the PR @Xget7 , all seems good, merging it in after CI passes. |
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.
Adds
setLocaleIdentifier(string | null)to the native bridges, hooks API and compat API so apps can change Superwall's locale after configuration.nullrestores the device locale.Continues #162 by @funCapital. Their original implementation is preserved as an authored commit; this PR adds configuration gating, error propagation, tests and a changeset.
screen-recording-E9CDEFA7-3F14-432D-AE99-8B0AE0D6C475-1789386189347.mp4
Validation:
deviceLocalefromen_UStoes_ES;nullrestoreden_US.Medium_Phone(Android 16/API 36), the same hook changed nativedeviceLocalefromen_UStoes_ES;nullrestoreden_US.eslintscript.Localized paywall rendering was not tested.