Recommended: JavaScript SDK for React Native
While this SDK is still supported, we recommend using newer JavaScript SDK, which is optimized for React Native, but also comes with a host of other benefits.
locale object to createClient when initializing the SDK, and you can switch the active language at runtime through client.locale.changeLanguage.
Quick override
Change UI text by overriding the copy key inlocale. The object is keyed by language code, and each language value contains nested translation overrides that match the SDK’s default English copy structure.
Supported languages
The top-level keys oflocale must be one of the following language codes:
Any top-level language key that is not in the supported list is dropped. Other valid entries are still applied.
Full guide
In this guide we will override the “Select your wallet” text to “Find your favorite” in English and add an Italian translation. The key for that text isdyn_login.title.all_wallet_list.
Translation structure
Thelocale value is a nested object whose shape mirrors the SDK’s translation resource. You can override nested objects arbitrarily deeply.
dyn_login.title.all and dyn_login.title.all_wallet_list.
Adding a new language
To add a translation for a language that is not yet bundled, provide the same keys under that language code:The SDK falls back to
en for any key that is not provided in the chosen language. You do not need to mirror the entire translation tree.Changing language at runtime
You can change the active language after initialization using thelocale module on the client:
Validation and sanitization
Thelocale object is sent to the webview controller through the SDK manifest. The webview validates the structure before applying it:
- The root value must be an object.
- Each top-level key must be a supported language code.
- The value for each language must be an object (translation overrides).
- Invalid top-level keys are dropped, and the rest of the object is still applied.
- If the root value is not an object, the whole locale is ignored.
en entry and drops the unsupported xx key:
Validation messages and form errors
You can also override validation copy. For example, the email and phone form validation keys live underdyn_login:
dyn_login.email_form.validationdyn_login.phone_number_form.validationdyn_login.phone_number_form.too_shortdyn_active_wallet_info.testnet_warningdyn_send.error.invalid_balance
Runtime language changes
You can switch the active language at runtime after the SDK has initialized. The language code must match a top-level key in thelocale object you passed to createClient.
en for any missing keys.
Complete example
Troubleshooting
- Overrides do not appear: Make sure the language code is supported and the key path matches the dot-separated copy key exactly.
- Invalid language is ignored: The webview controller drops unsupported top-level language keys. Check that you are using one of the 17 supported codes.
- Entire locale is ignored: If the root value is not a valid object, the whole locale is discarded. Ensure
localeis an object and not a string or array.