Skip to content

Unable to pass lang locale #28

Closed as not planned
Closed as not planned

Description

@vicovictor

The Airwallex native SDK already supports locale. On iOS, AWXSession has a lang property, and the newer SDK API also exposes a lang argument. The problem was the airwallex-payment-react-native wrapper we’re using never forwarded any locale from JS into the native session, so the payment form stayed on system/default behavior.

Had to patch the SDK this way:

diff --git a/node_modules/airwallex-payment-react-native/ios/AirwallexSdk+Session.swift b/node_modules/airwallex-payment-react-native/ios/AirwallexSdk+Session.swift
--- a/node_modules/airwallex-payment-react-native/ios/AirwallexSdk+Session.swift
+++ b/node_modules/airwallex-payment-react-native/ios/AirwallexSdk+Session.swift
@@ -86,6 +86,9 @@ private extension AWXSession {
             }
         }
         countryCode = params["countryCode"] as! String
+        if let lang = params["lang"] as? String {
+            self.lang = lang
+        }
         if let returnUrl = params["returnUrl"] as? String {
             self.returnURL = returnUrl
         }

Separate question: can Airwallex support more locales? Or how can we extend the locales?

Activity

  1. weiping-awx commented on Apr 8, 2026

    @weiping-awx
    Contributor

    Hi @vicovictor,
    Thank you for reaching out. The lang parameter on AWXSession is passed to the Airwallex backend API so that it can return localized content from the server side. However, it does not control the full UI localization of the SDK — for example, it won't override the language used by the iOS SDK's native UI components, which follow the device's system language.

    At this time, we don't have plans to support forcing a specific locale that overrides the device language for the SDK's UI. If this is something important for your use case, we'd encourage you to reach out to your account manager or our customer support team so we can better understand the requirement and prioritize accordingly.

    Thanks again for the feedback!

  2. weiping-awx commented on Apr 8, 2026

    @weiping-awx
    Contributor

    Separate question: can Airwallex support more locales? Or how can we extend the locales?

    Yes — we’re planning to support more locales to align with the Airwallex JS SDK, and this is expected to be included in one of the upcoming releases.

  3. weiping-awx commented on Aug 26, 2026

    @weiping-awx
    Contributor

    Hi @vicovictor, #60 added support for specifying lang in the SDK. You can try it in the latest release, 0.4.0.

    However, we haven’t aligned the supported locales with the JS SDK yet, so the currently supported languages are: English, Simplified Chinese, Traditional Chinese, French, German, Japanese, Korean, Portuguese (Portugal), Portuguese (Brazil), Russian, Spanish, and Thai.

    Please let us know if you have any feedback on this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions