Native Android
š Native Android Internationalization for Ditto ID SDK
This guide provides steps to programmatically change the SDK language in a Native Android app using the Ditto ID SDK, based on Section 11.5.2 of the integration guide.
š§¾ Overview
Internationalization allows users to select their preferred language within the app. To reflect this change in all Ditto ID SDK components, you must store the selected locale in the appās shared preferences so that the SDK can adapt accordingly.
š§ Implementation
Use the following code snippets to store the locale when the user changes the app language.
š± Java
public void setSDKLanguage(String locale, RDNA.RDNALanguageDirection languageDirection){
// Example locale: "es" for Spanish, "fr" for French
rdna.setSDKLanguage(locale, languageDirection);
}š± Kotlin
fun setLocale(locale: String, languageDirection : RDNA.RDNALanguageDirection) {
// Example locale: "es" for Spanish, "fr" for French
val result = rdna.setSDKLanguage(locale, languageDirection)
}š§ Notes
- The locale string should be in the ISO 639-1 format (e.g.,
"en","hi","de").
By saving the selected locale this way, the Ditto ID SDK will dynamically adapt its UI and messages to the userās language preference, enabling full internationalization support.
Updated 2 months ago
