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
| Module | File Name |
|---|---|
| Ditto ID | RELID.strings |
| Ditto MTD | MTD.strings |
| IDV Core | IDVCore.strings |
| Document Capture | IDVDocumentCapture.strings |
| Selfie Capture | IDVSelfieCapture.strings |
🛠️ Steps to Add Localization (iOS)
-
Get the
.stringsfiles for each module from Ditto admin. -
Integrate the required string file:
- For example,
IDVDocumentCapture.strings.
- For example,
-
Drag and Drop the
.stringsfile into your Xcode project. -
Localize the File:
- Select the added file in the Xcode project navigator.
- Open the Identity Inspector.
- Click Localize.
-
Enable Base Internationalization:
- Go to the Project > Info > Localizations section.
- Check the box Use Base Internationalization.
-
Add a New Language:
- Click the + button under Localizations.
- Select the language you want to support (e.g., French, Hindi).
-
Create Localized Version:
- Select the newly added
.stringsfile. - Choose to create a new file like
IDVDocumentCapture.fr.strings.
- Select the newly added
-
Override or Add Translations:
- Add localized strings for the selected language in the newly created
.stringsfile.
- Add localized strings for the selected language in the newly created
💡 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 messagesstrings_mtd.xml— For Ditto ID MTD messagesstrings-idv.xml— For Ditto ID Core messagesstrings-idv-doc-scan.xml— For document scanner modulestrings-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 → New → Android 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 messagesstrings_mtd.xml— For Ditto ID MTD messagesstrings-idv.xmlstrings-idv-doc-scan.xmlstrings-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.
Updated 2 months ago
