Skip to content

feat: support runtime locale changes in hooks and compat - #232

Merged
ianrumac merged 4 commits into
superwall:mainfrom
Xget7:feat/runtime-locale-identifier
Sep 15, 2026
Merged

ianrumac merged 4 commits into
superwall:mainfrom
Xget7:feat/runtime-locale-identifier

Conversation

@Xget7

@Xget7 Xget7 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Adds setLocaleIdentifier(string | null) to the native bridges, hooks API and compat API so apps can change Superwall's locale after configuration. null restores 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:

  • Build and 17 tests passed.
  • iOS native build passed.
  • On an iPhone 17 Pro simulator (iOS 26.5), the public hook changed native deviceLocale from en_US to es_ES; null restored en_US.
  • Android native build passed. On Medium_Phone (Android 16/API 36), the same hook changed native deviceLocale from en_US to es_ES; null restored en_US.
  • Lint could not run because the repository does not provide the referenced eslint script.

Localized paywall rendering was not tested.

funCapital and others added 2 commits September 14, 2026 06:57
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
Xget7 marked this pull request as draft September 14, 2026 10:55
@pkg-pr-new

pkg-pr-new Bot commented Sep 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/expo-superwall@232

commit: 66dbb32

@Xget7
Xget7 marked this pull request as ready for review September 14, 2026 22:20
@ianrumac

Copy link
Copy Markdown
Contributor

Thanks for the PR @Xget7 , all seems good, merging it in after CI passes.

@ianrumac
ianrumac merged commit f1e5b0c into superwall:main Sep 15, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants