React Native

Test

🌐 React Native Localization Setup for Ditto ID SDK

This guide provides step-by-step instructions to configure localization for Ditto ID SDK in a React Native project, specifically for iOS.

🏷️ Overview

Ditto ID npm modules support localization to customize strings for different languages. English is the default language. Ditto provides .strings files for English and supports integration of additional languages.

📦 String Files by Module

ModuleFile Name
Ditto IDRELID.strings
Ditto MTDMTD.strings
IDV CoreIDVCore.strings
Document CaptureIDVDocumentCapture.strings
Selfie CaptureIDVSelfieCapture.strings

🛠️ Steps to Add Localization (iOS)

  1. Get the.strings files for each module from Ditto admin.

  2. Integrate the required string file:

    • For example, IDVDocumentCapture.strings.
  3. Drag and Drop the .strings file into your Xcode project.

  4. Localize the File:

    • Select the added file in the Xcode project navigator.
    • Open the Identity Inspector.
    • Click Localize.
  5. Enable Base Internationalization:

    • Go to the Project > Info > Localizations section.
    • Check the box Use Base Internationalization.
  6. Add a New Language:

    • Click the + button under Localizations.
    • Select the language you want to support (e.g., French, Hindi).
  7. Create Localized Version:

    • Select the newly added .strings file.
    • Choose to create a new file like IDVDocumentCapture.fr.strings.
  8. Override or Add Translations:

    • Add localized strings for the selected language in the newly created .strings file.

💡 Example

To support French, create a file named IDVDocumentCapture.fr.strings and override or add translations like:

"SCAN_DOCUMENT_PROMPT" = "Veuillez scanner le document";
"CAPTURE_SELFIE_PROMPT" = "Veuillez capturer un selfie";

🔁 Repeat for Other Modules

Follow the same steps for rest of the other modules:


This enables full multilingual support in your React Native iOS application using the Ditto ID SDK.


🤖 Android Localization Setup for Ditto ID SDK (React Native)

This guide outlines how to enable and customize localization for the Ditto ID SDK on the Android platform in a React Native project.


🏷️ Overview

Ditto ID SDK supports multilingual localization for various components like document scanning and selfie capture. Android developers can customize SDK strings by copying and modifying XML files provided by the Ditto team.


🧰 Required String Files

Ensure the following XML files are received from the Ditto ID admin:

  • strings_rel_id.xml — For Ditto ID wrapper and core messages
  • strings_mtd.xml — For Ditto ID MTD messages
  • strings-idv.xml — For Ditto ID Core messages
  • strings-idv-doc-scan.xml — For document scanner module
  • strings-idv-face-scan.xml — For selfie capture module

🛠️ Integration Steps

1. Open Android Studio

Open your React Native Android project in Android Studio.

2. Create Locale Resource Directory

Right-click on the res folder → NewAndroid Resource Directory.

  • Select Resource type as values.
  • Under Locale, choose the target language and region (e.g., Russian - values-ru-rRU).

3. Copy XML Files

Place the following files (shared by Ditto ID admin) in the newly created values-<locale> folder:

  • strings_rel_id.xml — For Ditto ID wrapper and core messages
  • strings_mtd.xml — For Ditto ID MTD messages
  • strings-idv.xml
  • strings-idv-doc-scan.xml
  • strings-idv-face-scan.xml

4. Modify String Values

Open each XML file and override or translate the values for localization.

<string name="scan_document_prompt">Пожалуйста, отсканируйте документ</string>
<string name="capture_selfie_prompt">Пожалуйста, сделайте селфи</string>

Repeat for all keys that you want to customize.


🧠 Notes

  • These XML files are used internally by the Ditto ID SDK modules.
  • If you wish to maintain centralized string files, you may merge values into your app's strings.xml, but ensure key names are preserved.
  • To support multiple languages, repeat the process for each locale (values-fr, values-hi, etc.)

This localization setup ensures your Android application delivers a seamless, native multilingual experience using Ditto ID SDK components.