@transfergratis/react-native-sdk 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/axios.d.ts +30 -0
- package/build/api/axios.d.ts.map +1 -0
- package/build/api/axios.js +92 -0
- package/build/api/axios.js.map +1 -0
- package/build/components/EnhancedCameraView.d.ts +1 -41
- package/build/components/EnhancedCameraView.d.ts.map +1 -1
- package/build/components/EnhancedCameraView.js +75 -34
- package/build/components/EnhancedCameraView.js.map +1 -1
- package/build/components/EnhancedCameraView.web.d.ts +1 -41
- package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
- package/build/components/EnhancedCameraView.web.js +28 -4
- package/build/components/EnhancedCameraView.web.js.map +1 -1
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts +2 -2
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/CountrySelectionTemplate.js +77 -114
- package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
- package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/FileUploadTemplate.js +7 -3
- package/build/components/KYCElements/FileUploadTemplate.js.map +1 -1
- package/build/components/KYCElements/IDCardCapture.d.ts +7 -2
- package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
- package/build/components/KYCElements/IDCardCapture.js +253 -104
- package/build/components/KYCElements/IDCardCapture.js.map +1 -1
- package/build/components/KYCElements/InitializationStep.d.ts +5 -0
- package/build/components/KYCElements/InitializationStep.d.ts.map +1 -0
- package/build/components/KYCElements/InitializationStep.js +41 -0
- package/build/components/KYCElements/InitializationStep.js.map +1 -0
- package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/LocationCaptureTemplate.js +15 -13
- package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCapture.d.ts +2 -2
- package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +2 -2
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +2 -2
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
- package/build/components/KYCElements/ReviewSubmitTemplate.d.ts +12 -0
- package/build/components/KYCElements/ReviewSubmitTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/ReviewSubmitTemplate.js +171 -0
- package/build/components/KYCElements/ReviewSubmitTemplate.js.map +1 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts +6 -2
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/SelfieCaptureTemplate.js +137 -38
- package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
- package/build/components/KYCElements/VerificationProgressTemplate.d.ts +12 -0
- package/build/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/VerificationProgressTemplate.js +194 -0
- package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -0
- package/build/components/OverLay/IdCard.d.ts +1 -1
- package/build/components/OverLay/IdCard.d.ts.map +1 -1
- package/build/components/OverLay/IdCard.js +10 -6
- package/build/components/OverLay/IdCard.js.map +1 -1
- package/build/components/OverLay/SelfieOverlay.d.ts +1 -1
- package/build/components/OverLay/SelfieOverlay.d.ts.map +1 -1
- package/build/components/OverLay/SelfieOverlay.js +5 -4
- package/build/components/OverLay/SelfieOverlay.js.map +1 -1
- package/build/components/OverLay/type.d.ts +71 -1
- package/build/components/OverLay/type.d.ts.map +1 -1
- package/build/components/OverLay/type.js.map +1 -1
- package/build/components/TemplateKYCExample.d.ts +4 -1
- package/build/components/TemplateKYCExample.d.ts.map +1 -1
- package/build/components/TemplateKYCExample.js +74 -199
- package/build/components/TemplateKYCExample.js.map +1 -1
- package/build/components/TemplateKYCFlowRefactored.d.ts +3 -2
- package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
- package/build/components/TemplateKYCFlowRefactored.js +64 -40
- package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
- package/build/components/example/OrientationVideoExample.d.ts.map +1 -1
- package/build/components/example/OrientationVideoExample.js +1 -5
- package/build/components/example/OrientationVideoExample.js.map +1 -1
- package/build/config/countriesData.d.ts +3 -0
- package/build/config/countriesData.d.ts.map +1 -0
- package/build/config/countriesData.js +79 -0
- package/build/config/countriesData.js.map +1 -0
- package/build/config/region_mapping.d.ts +3 -0
- package/build/config/region_mapping.d.ts.map +1 -0
- package/build/config/region_mapping.js +687 -0
- package/build/config/region_mapping.js.map +1 -0
- package/build/hooks/useI18n.d.ts +11 -0
- package/build/hooks/useI18n.d.ts.map +1 -0
- package/build/hooks/useI18n.js +37 -0
- package/build/hooks/useI18n.js.map +1 -0
- package/build/hooks/useOrientationVideo.d.ts +1 -2
- package/build/hooks/useOrientationVideo.d.ts.map +1 -1
- package/build/hooks/useOrientationVideo.js +2 -1
- package/build/hooks/useOrientationVideo.js.map +1 -1
- package/build/hooks/useRealtimeVerifier.d.ts +28 -0
- package/build/hooks/useRealtimeVerifier.d.ts.map +1 -0
- package/build/hooks/useRealtimeVerifier.js +91 -0
- package/build/hooks/useRealtimeVerifier.js.map +1 -0
- package/build/hooks/useTemplateKYCFlow.d.ts +6 -3
- package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
- package/build/hooks/useTemplateKYCFlow.js +356 -42
- package/build/hooks/useTemplateKYCFlow.js.map +1 -1
- package/build/i18n/en/index.d.ts +168 -0
- package/build/i18n/en/index.d.ts.map +1 -0
- package/build/i18n/en/index.js +195 -0
- package/build/i18n/en/index.js.map +1 -0
- package/build/i18n/fr/index.d.ts +168 -0
- package/build/i18n/fr/index.d.ts.map +1 -0
- package/build/i18n/fr/index.js +194 -0
- package/build/i18n/fr/index.js.map +1 -0
- package/build/i18n/index.d.ts +10 -0
- package/build/i18n/index.d.ts.map +1 -0
- package/build/i18n/index.js +56 -0
- package/build/i18n/index.js.map +1 -0
- package/build/i18n/types.d.ts +153 -0
- package/build/i18n/types.d.ts.map +1 -0
- package/build/i18n/types.js +3 -0
- package/build/i18n/types.js.map +1 -0
- package/build/i18n/usage-example.d.ts +4 -0
- package/build/i18n/usage-example.d.ts.map +1 -0
- package/build/i18n/usage-example.js +189 -0
- package/build/i18n/usage-example.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/modules/api/CardAuthentification.d.ts +22 -0
- package/build/modules/api/CardAuthentification.d.ts.map +1 -0
- package/build/modules/api/CardAuthentification.js +107 -0
- package/build/modules/api/CardAuthentification.js.map +1 -0
- package/build/modules/api/KYCService.d.ts +58 -1
- package/build/modules/api/KYCService.d.ts.map +1 -1
- package/build/modules/api/KYCService.js +304 -27
- package/build/modules/api/KYCService.js.map +1 -1
- package/build/modules/api/SelfieVerification.d.ts +3 -0
- package/build/modules/api/SelfieVerification.d.ts.map +1 -0
- package/build/modules/api/SelfieVerification.js +9 -0
- package/build/modules/api/SelfieVerification.js.map +1 -0
- package/build/modules/api/backendApi.d.ts +2 -0
- package/build/modules/api/backendApi.d.ts.map +1 -0
- package/build/modules/api/backendApi.js +6 -0
- package/build/modules/api/backendApi.js.map +1 -0
- package/build/modules/api/types.d.ts +45 -0
- package/build/modules/api/types.d.ts.map +1 -0
- package/build/modules/api/types.js +2 -0
- package/build/modules/api/types.js.map +1 -0
- package/build/types/KYC.types.d.ts +56 -7
- package/build/types/KYC.types.d.ts.map +1 -1
- package/build/types/KYC.types.js +9 -1
- package/build/types/KYC.types.js.map +1 -1
- package/build/utils/cropByObb.d.ts +11 -0
- package/build/utils/cropByObb.d.ts.map +1 -0
- package/build/utils/cropByObb.js +78 -0
- package/build/utils/cropByObb.js.map +1 -0
- package/build/utils/get-document-type-info.d.ts +13 -0
- package/build/utils/get-document-type-info.d.ts.map +1 -0
- package/build/utils/get-document-type-info.js +59 -0
- package/build/utils/get-document-type-info.js.map +1 -0
- package/build/utils/pathToBase64.d.ts +3 -0
- package/build/utils/pathToBase64.d.ts.map +1 -0
- package/build/utils/pathToBase64.js +47 -0
- package/build/utils/pathToBase64.js.map +1 -0
- package/build/utils/remove-duplicate.d.ts +2 -0
- package/build/utils/remove-duplicate.d.ts.map +1 -0
- package/build/utils/remove-duplicate.js +4 -0
- package/build/utils/remove-duplicate.js.map +1 -0
- package/build/web/WebKYCEntry.d.ts +9 -0
- package/build/web/WebKYCEntry.d.ts.map +1 -0
- package/build/web/WebKYCEntry.js +156 -0
- package/build/web/WebKYCEntry.js.map +1 -0
- package/build/web/index.d.ts +2 -0
- package/build/web/index.d.ts.map +1 -0
- package/build/web/index.js +2 -0
- package/build/web/index.js.map +1 -0
- package/package.json +3 -1
- package/src/api/axios.ts +144 -0
- package/src/components/EnhancedCameraView.tsx +96 -78
- package/src/components/EnhancedCameraView.web.tsx +41 -40
- package/src/components/KYCElements/CountrySelectionTemplate.tsx +111 -136
- package/src/components/KYCElements/FileUploadTemplate.tsx +14 -8
- package/src/components/KYCElements/IDCardCapture.tsx +311 -115
- package/src/components/KYCElements/InitializationStep.tsx +53 -0
- package/src/components/KYCElements/LocationCaptureTemplate.tsx +17 -15
- package/src/components/KYCElements/OrientationVideoCapture.tsx +2 -2
- package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +2 -2
- package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +2 -2
- package/src/components/KYCElements/ReviewSubmitTemplate.tsx +201 -0
- package/src/components/KYCElements/SelfieCaptureTemplate.tsx +174 -57
- package/src/components/KYCElements/VerificationProgressTemplate.tsx +246 -0
- package/src/components/OverLay/IdCard.tsx +17 -9
- package/src/components/OverLay/SelfieOverlay.tsx +6 -5
- package/src/components/OverLay/type.ts +64 -2
- package/src/components/TemplateKYCExample.tsx +80 -200
- package/src/components/TemplateKYCFlowRefactored.tsx +80 -48
- package/src/components/example/OrientationVideoExample.tsx +3 -7
- package/src/config/countriesData.ts +84 -0
- package/src/config/region_mapping.ts +688 -0
- package/src/hooks/useI18n.ts +53 -0
- package/src/hooks/useOrientationVideo.ts +2 -2
- package/src/hooks/useRealtimeVerifier.ts +128 -0
- package/src/hooks/useTemplateKYCFlow.tsx +407 -57
- package/src/i18n/README.md +288 -0
- package/src/i18n/en/index.ts +206 -0
- package/src/i18n/fr/index.ts +205 -0
- package/src/i18n/index.ts +65 -0
- package/src/i18n/types.ts +172 -0
- package/src/i18n/usage-example.tsx +202 -0
- package/src/index.ts +3 -0
- package/src/modules/api/CardAuthentification.ts +114 -0
- package/src/modules/api/KYCService.ts +350 -30
- package/src/modules/api/SelfieVerification.ts +11 -0
- package/src/modules/api/backendApi.ts +8 -0
- package/src/modules/api/types.ts +51 -0
- package/src/types/KYC.types.ts +82 -14
- package/src/utils/cropByObb.ts +99 -0
- package/src/utils/get-document-type-info.ts +62 -0
- package/src/utils/pathToBase64.ts +47 -0
- package/src/utils/remove-duplicate.ts +3 -0
- package/src/web/WebKYCEntry.tsx +215 -0
- package/src/web/index.ts +1 -0
- package/src/types/nativewind.d.ts +0 -2
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# 🌍 Système d'Internationalisation (i18n) - Transfergratis SDK
|
|
2
|
+
|
|
3
|
+
Ce système d'internationalisation permet de traduire facilement votre application KYC en plusieurs langues.
|
|
4
|
+
|
|
5
|
+
## 📁 Structure des fichiers
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/i18n/
|
|
9
|
+
├── index.ts # Configuration principale i18n-js
|
|
10
|
+
├── types.ts # Types TypeScript
|
|
11
|
+
├── usage-example.tsx # Exemple d'utilisation
|
|
12
|
+
├── README.md # Documentation
|
|
13
|
+
├── en/ # Traductions anglaises
|
|
14
|
+
│ └── index.ts
|
|
15
|
+
└── fr/ # Traductions françaises
|
|
16
|
+
└── index.ts
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 🚀 Utilisation rapide
|
|
20
|
+
|
|
21
|
+
### 1. Import du hook
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { useI18n } from '../hooks/useI18n';
|
|
25
|
+
|
|
26
|
+
const MyComponent = () => {
|
|
27
|
+
const { t, locale, setLocale } = useI18n();
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<View>
|
|
31
|
+
<Text>{t('kyc.title')}</Text>
|
|
32
|
+
<Button title={t('common.next')} onPress={() => {}} />
|
|
33
|
+
</View>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. Changement de langue
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
const { setLocale, availableLocales } = useI18n();
|
|
42
|
+
|
|
43
|
+
// Changer la langue
|
|
44
|
+
setLocale('fr');
|
|
45
|
+
|
|
46
|
+
// Obtenir les langues disponibles
|
|
47
|
+
console.log(availableLocales); // ['en', 'fr']
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 3. Interpolation de variables
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
// Dans les traductions : "Step {current} of {total}"
|
|
54
|
+
const stepText = t('kyc.step', { current: 1, total: 5 });
|
|
55
|
+
// Résultat : "Step 1 of 5"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 4. Pluralisation
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
// Dans les traductions : "You have {count} message(s)"
|
|
62
|
+
const messageText = tPlural('messages.count', 3);
|
|
63
|
+
// Résultat : "You have 3 messages"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 📝 Clés de traduction disponibles
|
|
67
|
+
|
|
68
|
+
### Éléments communs
|
|
69
|
+
- `common.next` - "Next" / "Suivant"
|
|
70
|
+
- `common.previous` - "Previous" / "Précédent"
|
|
71
|
+
- `common.continue` - "Continue" / "Continuer"
|
|
72
|
+
- `common.cancel` - "Cancel" / "Annuler"
|
|
73
|
+
- `common.submit` - "Submit" / "Soumettre"
|
|
74
|
+
- `common.retry` - "Retry" / "Réessayer"
|
|
75
|
+
- `common.close` - "Close" / "Fermer"
|
|
76
|
+
- `common.back` - "Back" / "Retour"
|
|
77
|
+
- `common.loading` - "Loading..." / "Chargement..."
|
|
78
|
+
- `common.error` - "Error" / "Erreur"
|
|
79
|
+
- `common.success` - "Success" / "Succès"
|
|
80
|
+
|
|
81
|
+
### Flux KYC
|
|
82
|
+
- `kyc.title` - "Identity Verification" / "Vérification d'Identité"
|
|
83
|
+
- `kyc.subtitle` - "Complete your identity verification" / "Complétez votre vérification d'identité"
|
|
84
|
+
- `kyc.step` - "Step {current} of {total}" / "Étape {current} sur {total}"
|
|
85
|
+
|
|
86
|
+
#### Initialisation
|
|
87
|
+
- `kyc.initialization.title` - "Welcome to Identity Verification"
|
|
88
|
+
- `kyc.initialization.description` - "We need to verify your identity..."
|
|
89
|
+
- `kyc.initialization.startButton` - "Start Verification"
|
|
90
|
+
- `kyc.initialization.requirements` - "What you'll need:"
|
|
91
|
+
- `kyc.initialization.requirementsList` - Array des exigences
|
|
92
|
+
|
|
93
|
+
#### Sélection de pays
|
|
94
|
+
- `kyc.countrySelection.title` - "Select Your Country"
|
|
95
|
+
- `kyc.countrySelection.subtitle` - "Choose the country that issued your ID"
|
|
96
|
+
- `kyc.countrySelection.searchPlaceholder` - "Search for your country..."
|
|
97
|
+
- `kyc.countrySelection.noResults` - "No countries found"
|
|
98
|
+
- `kyc.countrySelection.selectCountry` - "Select Country"
|
|
99
|
+
|
|
100
|
+
#### Capture de carte d'identité
|
|
101
|
+
- `kyc.idCardCapture.title` - "Capture Your ID Document"
|
|
102
|
+
- `kyc.idCardCapture.subtitle` - "Take a clear photo of your ID document"
|
|
103
|
+
- `kyc.idCardCapture.frontSide` - "Front Side"
|
|
104
|
+
- `kyc.idCardCapture.backSide` - "Back Side"
|
|
105
|
+
- `kyc.idCardCapture.instructions.title` - "Instructions:"
|
|
106
|
+
- `kyc.idCardCapture.instructions.list` - Array des instructions
|
|
107
|
+
- `kyc.idCardCapture.captureButton` - "Capture Photo"
|
|
108
|
+
- `kyc.idCardCapture.retakeButton` - "Retake"
|
|
109
|
+
- `kyc.idCardCapture.usePhotoButton` - "Use This Photo"
|
|
110
|
+
- `kyc.idCardCapture.processing` - "Processing image..."
|
|
111
|
+
- `kyc.idCardCapture.success` - "ID captured successfully"
|
|
112
|
+
- `kyc.idCardCapture.error` - "Failed to capture ID. Please try again."
|
|
113
|
+
|
|
114
|
+
#### Capture de selfie
|
|
115
|
+
- `kyc.selfieCapture.title` - "Take a Selfie"
|
|
116
|
+
- `kyc.selfieCapture.subtitle` - "Take a clear selfie for identity verification"
|
|
117
|
+
- `kyc.selfieCapture.instructions.title` - "Instructions:"
|
|
118
|
+
- `kyc.selfieCapture.instructions.list` - Array des instructions
|
|
119
|
+
- `kyc.selfieCapture.captureButton` - "Take Selfie"
|
|
120
|
+
- `kyc.selfieCapture.retakeButton` - "Retake"
|
|
121
|
+
- `kyc.selfieCapture.usePhotoButton` - "Use This Photo"
|
|
122
|
+
- `kyc.selfieCapture.processing` - "Processing selfie..."
|
|
123
|
+
- `kyc.selfieCapture.success` - "Selfie captured successfully"
|
|
124
|
+
- `kyc.selfieCapture.error` - "Failed to capture selfie. Please try again."
|
|
125
|
+
|
|
126
|
+
#### Upload de fichier
|
|
127
|
+
- `kyc.fileUpload.title` - "Upload Document"
|
|
128
|
+
- `kyc.fileUpload.subtitle` - "Upload a clear photo of your document"
|
|
129
|
+
- `kyc.fileUpload.selectFile` - "Select File"
|
|
130
|
+
- `kyc.fileUpload.uploadButton` - "Upload"
|
|
131
|
+
- `kyc.fileUpload.dragDropText` - "Drag and drop your file here..."
|
|
132
|
+
- `kyc.fileUpload.supportedFormats` - "Supported formats: JPG, PNG, PDF"
|
|
133
|
+
- `kyc.fileUpload.maxSize` - "Max file size: 10MB"
|
|
134
|
+
- `kyc.fileUpload.processing` - "Processing file..."
|
|
135
|
+
- `kyc.fileUpload.success` - "File uploaded successfully"
|
|
136
|
+
- `kyc.fileUpload.error` - "Failed to upload file. Please try again."
|
|
137
|
+
|
|
138
|
+
#### Progrès de vérification
|
|
139
|
+
- `kyc.verificationProgress.title` - "Verifying Your Identity"
|
|
140
|
+
- `kyc.verificationProgress.subtitle` - "Please wait while we verify your information"
|
|
141
|
+
- `kyc.verificationProgress.steps.analyzing` - "Analyzing documents..."
|
|
142
|
+
- `kyc.verificationProgress.steps.extracting` - "Extracting information..."
|
|
143
|
+
- `kyc.verificationProgress.steps.verifying` - "Verifying identity..."
|
|
144
|
+
- `kyc.verificationProgress.steps.complete` - "Verification complete"
|
|
145
|
+
- `kyc.verificationProgress.estimatedTime` - "Estimated time: 2-3 minutes"
|
|
146
|
+
- `kyc.verificationProgress.status.pending` - "Pending"
|
|
147
|
+
- `kyc.verificationProgress.status.processing` - "Processing"
|
|
148
|
+
- `kyc.verificationProgress.status.completed` - "Completed"
|
|
149
|
+
- `kyc.verificationProgress.status.failed` - "Failed"
|
|
150
|
+
|
|
151
|
+
#### Révision et soumission
|
|
152
|
+
- `kyc.reviewSubmit.title` - "Review Your Information"
|
|
153
|
+
- `kyc.reviewSubmit.subtitle` - "Please review the information we extracted"
|
|
154
|
+
- `kyc.reviewSubmit.personalInfo` - "Personal Information"
|
|
155
|
+
- `kyc.reviewSubmit.documentInfo` - "Document Information"
|
|
156
|
+
- `kyc.reviewSubmit.editButton` - "Edit"
|
|
157
|
+
- `kyc.reviewSubmit.submitButton` - "Submit for Verification"
|
|
158
|
+
- `kyc.reviewSubmit.confirmMessage` - "Are you sure you want to submit this information?"
|
|
159
|
+
- `kyc.reviewSubmit.processing` - "Submitting..."
|
|
160
|
+
- `kyc.reviewSubmit.success` - "Information submitted successfully"
|
|
161
|
+
- `kyc.reviewSubmit.error` - "Failed to submit information. Please try again."
|
|
162
|
+
|
|
163
|
+
### Caméra et médias
|
|
164
|
+
- `camera.permissionTitle` - "Camera Permission Required"
|
|
165
|
+
- `camera.permissionMessage` - "We need access to your camera..."
|
|
166
|
+
- `camera.permissionButton` - "Grant Permission"
|
|
167
|
+
- `camera.settingsButton` - "Open Settings"
|
|
168
|
+
- `camera.notAvailable` - "Camera not available"
|
|
169
|
+
- `camera.switchCamera` - "Switch Camera"
|
|
170
|
+
- `camera.flashOn` - "Flash On"
|
|
171
|
+
- `camera.flashOff` - "Flash Off"
|
|
172
|
+
- `camera.capturePhoto` - "Capture Photo"
|
|
173
|
+
- `camera.processing` - "Processing..."
|
|
174
|
+
|
|
175
|
+
### Erreurs
|
|
176
|
+
- `errors.networkError` - "Network error. Please check your connection."
|
|
177
|
+
- `errors.serverError` - "Server error. Please try again later."
|
|
178
|
+
- `errors.validationError` - "Please check your information and try again."
|
|
179
|
+
- `errors.cameraError` - "Camera error. Please try again."
|
|
180
|
+
- `errors.fileError` - "File error. Please try again."
|
|
181
|
+
- `errors.timeoutError` - "Request timeout. Please try again."
|
|
182
|
+
- `errors.unknownError` - "An unknown error occurred. Please try again."
|
|
183
|
+
|
|
184
|
+
### Validation
|
|
185
|
+
- `validation.required` - "This field is required"
|
|
186
|
+
- `validation.invalidEmail` - "Please enter a valid email address"
|
|
187
|
+
- `validation.invalidPhone` - "Please enter a valid phone number"
|
|
188
|
+
- `validation.invalidDate` - "Please enter a valid date"
|
|
189
|
+
- `validation.minLength` - "Must be at least {min} characters"
|
|
190
|
+
- `validation.maxLength` - "Must be no more than {max} characters"
|
|
191
|
+
- `validation.invalidFormat` - "Invalid format"
|
|
192
|
+
- `validation.fileTooLarge` - "File is too large"
|
|
193
|
+
- `validation.fileTypeNotSupported` - "File type not supported"
|
|
194
|
+
|
|
195
|
+
## 🔧 Ajouter une nouvelle langue
|
|
196
|
+
|
|
197
|
+
1. Créer un nouveau dossier dans `src/i18n/` (ex: `es/` pour l'espagnol)
|
|
198
|
+
2. Créer un fichier `index.ts` avec la même structure que `en/index.ts`
|
|
199
|
+
3. Ajouter la nouvelle locale au type `SupportedLocale` dans `types.ts`
|
|
200
|
+
4. Importer et ajouter les traductions dans `src/i18n/index.ts`
|
|
201
|
+
|
|
202
|
+
## 🔧 Ajouter une nouvelle clé de traduction
|
|
203
|
+
|
|
204
|
+
1. Ajouter la clé dans tous les fichiers de langue (`en/index.ts`, `fr/index.ts`, etc.)
|
|
205
|
+
2. Mettre à jour les types TypeScript dans `types.ts`
|
|
206
|
+
3. Utiliser la nouvelle clé dans vos composants avec `t('nouvelle.cle')`
|
|
207
|
+
|
|
208
|
+
## 📱 Exemple d'utilisation complète
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
import React from 'react';
|
|
212
|
+
import { View, Text, TouchableOpacity } from 'react-native';
|
|
213
|
+
import { useI18n } from '../hooks/useI18n';
|
|
214
|
+
|
|
215
|
+
const KYCScreen = () => {
|
|
216
|
+
const { t, locale, setLocale, availableLocales } = useI18n();
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
<View>
|
|
220
|
+
{/* Sélecteur de langue */}
|
|
221
|
+
<View style={{ flexDirection: 'row', gap: 10 }}>
|
|
222
|
+
{availableLocales.map((loc) => (
|
|
223
|
+
<TouchableOpacity
|
|
224
|
+
key={loc}
|
|
225
|
+
onPress={() => setLocale(loc)}
|
|
226
|
+
style={{
|
|
227
|
+
padding: 10,
|
|
228
|
+
backgroundColor: locale === loc ? '#007AFF' : '#F5F5F5'
|
|
229
|
+
}}
|
|
230
|
+
>
|
|
231
|
+
<Text style={{ color: locale === loc ? 'white' : 'black' }}>
|
|
232
|
+
{loc.toUpperCase()}
|
|
233
|
+
</Text>
|
|
234
|
+
</TouchableOpacity>
|
|
235
|
+
))}
|
|
236
|
+
</View>
|
|
237
|
+
|
|
238
|
+
{/* Contenu traduit */}
|
|
239
|
+
<Text style={{ fontSize: 24, fontWeight: 'bold' }}>
|
|
240
|
+
{t('kyc.title')}
|
|
241
|
+
</Text>
|
|
242
|
+
|
|
243
|
+
<Text style={{ fontSize: 16, marginBottom: 20 }}>
|
|
244
|
+
{t('kyc.subtitle')}
|
|
245
|
+
</Text>
|
|
246
|
+
|
|
247
|
+
{/* Boutons avec interpolation */}
|
|
248
|
+
<Text>
|
|
249
|
+
{t('kyc.step', { current: 1, total: 5 })}
|
|
250
|
+
</Text>
|
|
251
|
+
|
|
252
|
+
{/* Boutons d'action */}
|
|
253
|
+
<TouchableOpacity style={{ backgroundColor: '#007AFF', padding: 15 }}>
|
|
254
|
+
<Text style={{ color: 'white', textAlign: 'center' }}>
|
|
255
|
+
{t('kyc.initialization.startButton')}
|
|
256
|
+
</Text>
|
|
257
|
+
</TouchableOpacity>
|
|
258
|
+
</View>
|
|
259
|
+
);
|
|
260
|
+
};
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## 🎯 Bonnes pratiques
|
|
264
|
+
|
|
265
|
+
1. **Utilisez des clés descriptives** : `kyc.idCardCapture.instructions.title` au lieu de `instructions`
|
|
266
|
+
2. **Groupez les clés liées** : Utilisez la notation par points pour l'organisation
|
|
267
|
+
3. **Gardez les clés cohérentes** : Utilisez la même structure dans toutes les langues
|
|
268
|
+
4. **Testez toutes les langues** : Assurez-vous que toutes les clés existent dans tous les fichiers de langue
|
|
269
|
+
5. **Utilisez l'interpolation** : Pour le contenu dynamique, utilisez la syntaxe `{variable}`
|
|
270
|
+
6. **Gérez la pluralisation** : Utilisez `tPlural` pour le texte dépendant du nombre
|
|
271
|
+
|
|
272
|
+
## 🚀 Fonctionnalités avancées
|
|
273
|
+
|
|
274
|
+
### Support RTL (Right-to-Left)
|
|
275
|
+
Le système détecte automatiquement les langues RTL (arabe, hébreu, etc.) et ajuste l'interface.
|
|
276
|
+
|
|
277
|
+
### Fallback automatique
|
|
278
|
+
Si une traduction n'est pas trouvée, le système utilise automatiquement la langue par défaut.
|
|
279
|
+
|
|
280
|
+
### Types TypeScript
|
|
281
|
+
Toutes les traductions sont typées pour une meilleure sécurité et autocomplétion.
|
|
282
|
+
|
|
283
|
+
### Performance optimisée
|
|
284
|
+
Les traductions sont mises en cache et les re-rendus sont minimisés.
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
**Note** : Ce système est entièrement compatible avec React Native et fonctionne sur iOS, Android et Web.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
export const en = {
|
|
2
|
+
// Common UI elements
|
|
3
|
+
common: {
|
|
4
|
+
next: 'Next',
|
|
5
|
+
previous: 'Previous',
|
|
6
|
+
continue: 'Continue',
|
|
7
|
+
cancel: 'Cancel',
|
|
8
|
+
confirm: 'Confirm',
|
|
9
|
+
submit: 'Submit',
|
|
10
|
+
retry: 'Retry',
|
|
11
|
+
close: 'Close',
|
|
12
|
+
back: 'Back',
|
|
13
|
+
loading: 'Loading...',
|
|
14
|
+
error: 'Error',
|
|
15
|
+
success: 'Success',
|
|
16
|
+
warning: 'Warning',
|
|
17
|
+
info: 'Information',
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
// KYC Flow
|
|
21
|
+
kyc: {
|
|
22
|
+
title: 'Identity Verification',
|
|
23
|
+
subtitle: 'Complete your identity verification to continue',
|
|
24
|
+
step: 'Step %{current} of %{total}',
|
|
25
|
+
|
|
26
|
+
// Initialization
|
|
27
|
+
initialization: {
|
|
28
|
+
title: 'Welcome to Identity Verification',
|
|
29
|
+
description: 'We need to verify your identity to comply with regulations and ensure security.',
|
|
30
|
+
startButton: 'Start Verification',
|
|
31
|
+
requirements: 'What you\'ll need:',
|
|
32
|
+
requirementsList: [
|
|
33
|
+
'Valid government-issued ID',
|
|
34
|
+
'Good lighting for photos',
|
|
35
|
+
'Stable internet connection'
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
// Location Capture
|
|
40
|
+
locationCapture: {
|
|
41
|
+
title: 'Secure Your Verification',
|
|
42
|
+
description: 'Allow location access to help us protect your account and prevent fraudulent activity during verification.',
|
|
43
|
+
howThisHelps: 'How this helps:',
|
|
44
|
+
howThisHelpsList: '• Verifies your device location matches your identity\n• Detects and prevents unauthorized access\n• Ensures compliance with security regulations',
|
|
45
|
+
permissionDeniedTitle: 'Permission denied',
|
|
46
|
+
permissionDeniedMessage: 'Location permission is required to continue.',
|
|
47
|
+
locationDisabledTitle: 'Location disabled',
|
|
48
|
+
locationDisabledMessage: 'Please enable location services on your device to continue.',
|
|
49
|
+
errorTitle: 'Error',
|
|
50
|
+
errorMessage: 'Unable to retrieve your location. Please try again.',
|
|
51
|
+
obtained: 'Location obtained',
|
|
52
|
+
latitudeLabel: 'Latitude',
|
|
53
|
+
longitudeLabel: 'Longitude',
|
|
54
|
+
accuracyLabel: 'Accuracy',
|
|
55
|
+
resetButton: 'Reset',
|
|
56
|
+
enableButton: 'Enable Location Access',
|
|
57
|
+
fetching: 'Fetching...'
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// Country Selection
|
|
61
|
+
countrySelection: {
|
|
62
|
+
title: 'Select Your Country',
|
|
63
|
+
subtitle: 'Choose the country that issued your ID document',
|
|
64
|
+
searchPlaceholder: 'Search for your country...',
|
|
65
|
+
noResults: 'No countries found',
|
|
66
|
+
selectCountry: 'Select Country'
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
// ID Card Capture
|
|
70
|
+
idCardCapture: {
|
|
71
|
+
title: 'Capture Your ID Document',
|
|
72
|
+
subtitle: 'Take a clear photo of your ID document',
|
|
73
|
+
frontSide: 'Front Side',
|
|
74
|
+
backSide: 'Back Side',
|
|
75
|
+
instructions: {
|
|
76
|
+
title: 'Instructions:',
|
|
77
|
+
list: [
|
|
78
|
+
'Place your ID on a flat surface',
|
|
79
|
+
'Ensure good lighting',
|
|
80
|
+
'Keep the entire document in frame',
|
|
81
|
+
'Avoid glare and shadows'
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
captureButton: 'Capture Photo',
|
|
85
|
+
retakeButton: 'Retake',
|
|
86
|
+
usePhotoButton: 'Use This Photo',
|
|
87
|
+
processing: 'Processing image...',
|
|
88
|
+
success: 'ID captured successfully',
|
|
89
|
+
error: 'Failed to capture ID. Please try again.'
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
// Selfie Capture
|
|
93
|
+
selfieCapture: {
|
|
94
|
+
title: 'Take a Selfie',
|
|
95
|
+
subtitle: 'Take a clear selfie for identity verification',
|
|
96
|
+
instructions: {
|
|
97
|
+
title: 'Instructions:',
|
|
98
|
+
list: [
|
|
99
|
+
'Look directly at the camera',
|
|
100
|
+
'Ensure good lighting on your face',
|
|
101
|
+
'Remove glasses and hats',
|
|
102
|
+
'Keep a neutral expression'
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
captureButton: 'Take Selfie',
|
|
106
|
+
retakeButton: 'Retake',
|
|
107
|
+
usePhotoButton: 'Use This Photo',
|
|
108
|
+
processing: 'Processing selfie...',
|
|
109
|
+
success: 'Selfie captured successfully',
|
|
110
|
+
error: 'Failed to capture selfie. Please try again.'
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
// File Upload
|
|
114
|
+
fileUpload: {
|
|
115
|
+
title: 'Upload Document',
|
|
116
|
+
subtitle: 'Upload a clear photo of your document',
|
|
117
|
+
selectFile: 'Select File',
|
|
118
|
+
uploadButton: 'Upload',
|
|
119
|
+
dragDropText: 'Drag and drop your file here, or click to select',
|
|
120
|
+
supportedFormats: 'Supported formats: JPG, PNG, PDF',
|
|
121
|
+
maxSize: 'Max file size: 10MB',
|
|
122
|
+
processing: 'Processing file...',
|
|
123
|
+
success: 'File uploaded successfully',
|
|
124
|
+
error: 'Failed to upload file. Please try again.'
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
// Verification Progress
|
|
128
|
+
verificationProgress: {
|
|
129
|
+
title: 'Verifying Your Identity',
|
|
130
|
+
subtitle: 'Please wait while we verify your information',
|
|
131
|
+
steps: {
|
|
132
|
+
analyzing: 'Analyzing documents...',
|
|
133
|
+
extracting: 'Extracting information...',
|
|
134
|
+
verifying: 'Verifying identity...',
|
|
135
|
+
complete: 'Verification complete'
|
|
136
|
+
},
|
|
137
|
+
estimatedTime: 'Estimated time: 2-3 minutes',
|
|
138
|
+
status: {
|
|
139
|
+
pending: 'Pending',
|
|
140
|
+
processing: 'Processing',
|
|
141
|
+
completed: 'Completed',
|
|
142
|
+
failed: 'Failed'
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
// Review and Submit
|
|
147
|
+
reviewSubmit: {
|
|
148
|
+
title: 'Review Your Information',
|
|
149
|
+
subtitle: 'Please review the information we extracted',
|
|
150
|
+
personalInfo: 'Personal Information',
|
|
151
|
+
documentInfo: 'Document Information',
|
|
152
|
+
editButton: 'Edit',
|
|
153
|
+
submitButton: 'Submit for Verification',
|
|
154
|
+
confirmMessage: 'Are you sure you want to submit this information?',
|
|
155
|
+
processing: 'Submitting...',
|
|
156
|
+
success: 'Information submitted successfully',
|
|
157
|
+
error: 'Failed to submit information. Please try again.'
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
// Camera and Media
|
|
162
|
+
camera: {
|
|
163
|
+
permissionTitle: 'Camera Permission Required',
|
|
164
|
+
permissionMessage: 'We need access to your camera to capture your ID and selfie.',
|
|
165
|
+
permissionButton: 'Grant Permission',
|
|
166
|
+
settingsButton: 'Open Settings',
|
|
167
|
+
notAvailable: 'Camera not available',
|
|
168
|
+
switchCamera: 'Switch Camera',
|
|
169
|
+
flashOn: 'Flash On',
|
|
170
|
+
flashOff: 'Flash Off',
|
|
171
|
+
capturePhoto: 'Capture Photo',
|
|
172
|
+
processing: 'Processing...',
|
|
173
|
+
permissionRequired: 'Camera permission required. Please grant permission to continue.',
|
|
174
|
+
deviceNotAvailable: 'Camera device not available',
|
|
175
|
+
notReady: 'Camera not ready',
|
|
176
|
+
analyzing: 'Analyzing...',
|
|
177
|
+
errorOccurred: 'Camera error occurred',
|
|
178
|
+
failedToCapture: 'Failed to capture photo',
|
|
179
|
+
failedToStartRecording: 'Failed to start video recording',
|
|
180
|
+
failedToStopRecording: 'Failed to stop video recording'
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
// Errors
|
|
184
|
+
errors: {
|
|
185
|
+
networkError: 'Network error. Please check your connection.',
|
|
186
|
+
serverError: 'Server error. Please try again later.',
|
|
187
|
+
validationError: 'Please check your information and try again.',
|
|
188
|
+
cameraError: 'Camera error. Please try again.',
|
|
189
|
+
fileError: 'File error. Please try again.',
|
|
190
|
+
timeoutError: 'Request timeout. Please try again.',
|
|
191
|
+
unknownError: 'An unknown error occurred. Please try again.'
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
// Validation messages
|
|
195
|
+
validation: {
|
|
196
|
+
required: 'This field is required',
|
|
197
|
+
invalidEmail: 'Please enter a valid email address',
|
|
198
|
+
invalidPhone: 'Please enter a valid phone number',
|
|
199
|
+
invalidDate: 'Please enter a valid date',
|
|
200
|
+
minLength: 'Must be at least %{min} characters',
|
|
201
|
+
maxLength: 'Must be no more than %{max} characters',
|
|
202
|
+
invalidFormat: 'Invalid format',
|
|
203
|
+
fileTooLarge: 'File is too large',
|
|
204
|
+
fileTypeNotSupported: 'File type not supported'
|
|
205
|
+
}
|
|
206
|
+
};
|