How to Change the Language in Liveness Detection SDK

The Liveness Detection SDK is designed with multilingual capabilities, supporting several languages and voices: English, Indonesian, Chinese, Vietnamese, Hindi, and Thai. The SDK can automatically switch to the language set on the user’s mobile device, making it user-friendly and adaptable. However, there are scenarios where manual configurations may be needed. Here’s how to manage and troubleshoot language settings in the SDK:

1. Automatic Language Switching

The Liveness Detection SDK automatically aligns with the current language of the mobile phone. No additional code configuration is required for this functionality. However, keep the following points in mind:

  • Default Language: The default language of the SDK is English.
  • If the default language of your app is not English, you must manually replace the SDK’s default resources with those corresponding to your app’s default language.

 

2. Manually Setting the Default Language

If your app's default language is different from English, follow these steps:

  1. Locate the language resource files in the SDK directory:
    bash liveness/res
     
  2. Identify the resource file that matches your app’s default language.
  3. Replace the default English resource with the resource corresponding to your app's default language.

 

3. Troubleshooting Automatic Language Switching

If the SDK does not switch languages automatically with the system settings, verify the following:

  1. Check Device Language Settings:
    • Ensure that both the [Language] and [Region] settings on the device are configured correctly for the desired language.
  2. Restart the App:
    • After changing the device’s language settings, restart the app to apply the changes.

 

4. Restricting to a Single Language

In cases where your app supports only one language, you can filter out other languages using the resConfigs configuration in your project’s build.gradle file. For instance, to support only Indonesian, follow these steps:

  • Open your build.gradle file.
  • Add the following configuration to the android block:
android {
defaultConfig {
...
resConfigs("in-rID") // Replace "in-rID" with the resource configuration for your preferred language.
}
}
  • Replace "in-rID" with the appropriate language configuration code for your desired language.

 

5. Additional Notes for Developers

  • The SDK’s multilingual feature eliminates the need for extensive manual setup, making it convenient for developers to integrate it into multilingual apps.
  • Ensure that your app is using the latest SDK version to benefit from the most updated language resources and features.
  • Refer to the Liveness SDK API Documentation for detailed setup and configuration instructions.

 

Further Assistance
If you continue to experience issues despite following the guidelines provided, please contact our support team for further assistance:

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.