Cordova
š Cordova Internationalization for REL-ID IDV SDK
This document explains how to implement internationalization support in Cordova apps using the REL-ID IDV SDK (Section 11.3.2). It enables the SDK to adapt dynamically to the app's language setting at runtime.
š§¾ Overview
If your application supports language selection within the app, you must notify the REL-ID SDK whenever the language changes. This ensures all SDK components (UI prompts, messages) switch to the selected language.
š ļø Cordova Code Snippet
Add the following function in your Cordova app to set the SDK language dynamically:
function setAppLanguage(locale) {
// Example values: "es" for Spanish, "fr" for French
com.uniken.rdnaplugin.RdnaClient.setSDKLocale(
function onSuccess() {
console.log("SDK locale set successfully");
},
function onFailure() {
console.error("Failed to set SDK locale");
},
[locale]
);
}š§Ŗ Usage
Invoke setAppLanguage(locale) whenever the user changes the language preference in your app settings.
// Example: set to French
setAppLanguage("fr");š Notes
- The
localeparameter should follow standard language codes (e.g., "en", "fr", "ja"). - This change immediately affects all SDK modules integrated in the app.
By implementing this, the REL-ID SDK will respect your appās selected language, ensuring a cohesive and localized user experience throughout the IDV workflow.
Updated 9 months ago
