@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.
Files changed (216) hide show
  1. package/build/api/axios.d.ts +30 -0
  2. package/build/api/axios.d.ts.map +1 -0
  3. package/build/api/axios.js +92 -0
  4. package/build/api/axios.js.map +1 -0
  5. package/build/components/EnhancedCameraView.d.ts +1 -41
  6. package/build/components/EnhancedCameraView.d.ts.map +1 -1
  7. package/build/components/EnhancedCameraView.js +75 -34
  8. package/build/components/EnhancedCameraView.js.map +1 -1
  9. package/build/components/EnhancedCameraView.web.d.ts +1 -41
  10. package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
  11. package/build/components/EnhancedCameraView.web.js +28 -4
  12. package/build/components/EnhancedCameraView.web.js.map +1 -1
  13. package/build/components/KYCElements/CountrySelectionTemplate.d.ts +2 -2
  14. package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
  15. package/build/components/KYCElements/CountrySelectionTemplate.js +77 -114
  16. package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
  17. package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -1
  18. package/build/components/KYCElements/FileUploadTemplate.js +7 -3
  19. package/build/components/KYCElements/FileUploadTemplate.js.map +1 -1
  20. package/build/components/KYCElements/IDCardCapture.d.ts +7 -2
  21. package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  22. package/build/components/KYCElements/IDCardCapture.js +253 -104
  23. package/build/components/KYCElements/IDCardCapture.js.map +1 -1
  24. package/build/components/KYCElements/InitializationStep.d.ts +5 -0
  25. package/build/components/KYCElements/InitializationStep.d.ts.map +1 -0
  26. package/build/components/KYCElements/InitializationStep.js +41 -0
  27. package/build/components/KYCElements/InitializationStep.js.map +1 -0
  28. package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
  29. package/build/components/KYCElements/LocationCaptureTemplate.js +15 -13
  30. package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
  31. package/build/components/KYCElements/OrientationVideoCapture.d.ts +2 -2
  32. package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -1
  33. package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
  34. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +2 -2
  35. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -1
  36. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
  37. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +2 -2
  38. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -1
  39. package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
  40. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts +12 -0
  41. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts.map +1 -0
  42. package/build/components/KYCElements/ReviewSubmitTemplate.js +171 -0
  43. package/build/components/KYCElements/ReviewSubmitTemplate.js.map +1 -0
  44. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts +6 -2
  45. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
  46. package/build/components/KYCElements/SelfieCaptureTemplate.js +137 -38
  47. package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
  48. package/build/components/KYCElements/VerificationProgressTemplate.d.ts +12 -0
  49. package/build/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -0
  50. package/build/components/KYCElements/VerificationProgressTemplate.js +194 -0
  51. package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -0
  52. package/build/components/OverLay/IdCard.d.ts +1 -1
  53. package/build/components/OverLay/IdCard.d.ts.map +1 -1
  54. package/build/components/OverLay/IdCard.js +10 -6
  55. package/build/components/OverLay/IdCard.js.map +1 -1
  56. package/build/components/OverLay/SelfieOverlay.d.ts +1 -1
  57. package/build/components/OverLay/SelfieOverlay.d.ts.map +1 -1
  58. package/build/components/OverLay/SelfieOverlay.js +5 -4
  59. package/build/components/OverLay/SelfieOverlay.js.map +1 -1
  60. package/build/components/OverLay/type.d.ts +71 -1
  61. package/build/components/OverLay/type.d.ts.map +1 -1
  62. package/build/components/OverLay/type.js.map +1 -1
  63. package/build/components/TemplateKYCExample.d.ts +4 -1
  64. package/build/components/TemplateKYCExample.d.ts.map +1 -1
  65. package/build/components/TemplateKYCExample.js +74 -199
  66. package/build/components/TemplateKYCExample.js.map +1 -1
  67. package/build/components/TemplateKYCFlowRefactored.d.ts +3 -2
  68. package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
  69. package/build/components/TemplateKYCFlowRefactored.js +64 -40
  70. package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
  71. package/build/components/example/OrientationVideoExample.d.ts.map +1 -1
  72. package/build/components/example/OrientationVideoExample.js +1 -5
  73. package/build/components/example/OrientationVideoExample.js.map +1 -1
  74. package/build/config/countriesData.d.ts +3 -0
  75. package/build/config/countriesData.d.ts.map +1 -0
  76. package/build/config/countriesData.js +79 -0
  77. package/build/config/countriesData.js.map +1 -0
  78. package/build/config/region_mapping.d.ts +3 -0
  79. package/build/config/region_mapping.d.ts.map +1 -0
  80. package/build/config/region_mapping.js +687 -0
  81. package/build/config/region_mapping.js.map +1 -0
  82. package/build/hooks/useI18n.d.ts +11 -0
  83. package/build/hooks/useI18n.d.ts.map +1 -0
  84. package/build/hooks/useI18n.js +37 -0
  85. package/build/hooks/useI18n.js.map +1 -0
  86. package/build/hooks/useOrientationVideo.d.ts +1 -2
  87. package/build/hooks/useOrientationVideo.d.ts.map +1 -1
  88. package/build/hooks/useOrientationVideo.js +2 -1
  89. package/build/hooks/useOrientationVideo.js.map +1 -1
  90. package/build/hooks/useRealtimeVerifier.d.ts +28 -0
  91. package/build/hooks/useRealtimeVerifier.d.ts.map +1 -0
  92. package/build/hooks/useRealtimeVerifier.js +91 -0
  93. package/build/hooks/useRealtimeVerifier.js.map +1 -0
  94. package/build/hooks/useTemplateKYCFlow.d.ts +6 -3
  95. package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
  96. package/build/hooks/useTemplateKYCFlow.js +356 -42
  97. package/build/hooks/useTemplateKYCFlow.js.map +1 -1
  98. package/build/i18n/en/index.d.ts +168 -0
  99. package/build/i18n/en/index.d.ts.map +1 -0
  100. package/build/i18n/en/index.js +195 -0
  101. package/build/i18n/en/index.js.map +1 -0
  102. package/build/i18n/fr/index.d.ts +168 -0
  103. package/build/i18n/fr/index.d.ts.map +1 -0
  104. package/build/i18n/fr/index.js +194 -0
  105. package/build/i18n/fr/index.js.map +1 -0
  106. package/build/i18n/index.d.ts +10 -0
  107. package/build/i18n/index.d.ts.map +1 -0
  108. package/build/i18n/index.js +56 -0
  109. package/build/i18n/index.js.map +1 -0
  110. package/build/i18n/types.d.ts +153 -0
  111. package/build/i18n/types.d.ts.map +1 -0
  112. package/build/i18n/types.js +3 -0
  113. package/build/i18n/types.js.map +1 -0
  114. package/build/i18n/usage-example.d.ts +4 -0
  115. package/build/i18n/usage-example.d.ts.map +1 -0
  116. package/build/i18n/usage-example.js +189 -0
  117. package/build/i18n/usage-example.js.map +1 -0
  118. package/build/index.d.ts +1 -0
  119. package/build/index.d.ts.map +1 -1
  120. package/build/index.js +2 -0
  121. package/build/index.js.map +1 -1
  122. package/build/modules/api/CardAuthentification.d.ts +22 -0
  123. package/build/modules/api/CardAuthentification.d.ts.map +1 -0
  124. package/build/modules/api/CardAuthentification.js +107 -0
  125. package/build/modules/api/CardAuthentification.js.map +1 -0
  126. package/build/modules/api/KYCService.d.ts +58 -1
  127. package/build/modules/api/KYCService.d.ts.map +1 -1
  128. package/build/modules/api/KYCService.js +304 -27
  129. package/build/modules/api/KYCService.js.map +1 -1
  130. package/build/modules/api/SelfieVerification.d.ts +3 -0
  131. package/build/modules/api/SelfieVerification.d.ts.map +1 -0
  132. package/build/modules/api/SelfieVerification.js +9 -0
  133. package/build/modules/api/SelfieVerification.js.map +1 -0
  134. package/build/modules/api/backendApi.d.ts +2 -0
  135. package/build/modules/api/backendApi.d.ts.map +1 -0
  136. package/build/modules/api/backendApi.js +6 -0
  137. package/build/modules/api/backendApi.js.map +1 -0
  138. package/build/modules/api/types.d.ts +45 -0
  139. package/build/modules/api/types.d.ts.map +1 -0
  140. package/build/modules/api/types.js +2 -0
  141. package/build/modules/api/types.js.map +1 -0
  142. package/build/types/KYC.types.d.ts +56 -7
  143. package/build/types/KYC.types.d.ts.map +1 -1
  144. package/build/types/KYC.types.js +9 -1
  145. package/build/types/KYC.types.js.map +1 -1
  146. package/build/utils/cropByObb.d.ts +11 -0
  147. package/build/utils/cropByObb.d.ts.map +1 -0
  148. package/build/utils/cropByObb.js +78 -0
  149. package/build/utils/cropByObb.js.map +1 -0
  150. package/build/utils/get-document-type-info.d.ts +13 -0
  151. package/build/utils/get-document-type-info.d.ts.map +1 -0
  152. package/build/utils/get-document-type-info.js +59 -0
  153. package/build/utils/get-document-type-info.js.map +1 -0
  154. package/build/utils/pathToBase64.d.ts +3 -0
  155. package/build/utils/pathToBase64.d.ts.map +1 -0
  156. package/build/utils/pathToBase64.js +47 -0
  157. package/build/utils/pathToBase64.js.map +1 -0
  158. package/build/utils/remove-duplicate.d.ts +2 -0
  159. package/build/utils/remove-duplicate.d.ts.map +1 -0
  160. package/build/utils/remove-duplicate.js +4 -0
  161. package/build/utils/remove-duplicate.js.map +1 -0
  162. package/build/web/WebKYCEntry.d.ts +9 -0
  163. package/build/web/WebKYCEntry.d.ts.map +1 -0
  164. package/build/web/WebKYCEntry.js +156 -0
  165. package/build/web/WebKYCEntry.js.map +1 -0
  166. package/build/web/index.d.ts +2 -0
  167. package/build/web/index.d.ts.map +1 -0
  168. package/build/web/index.js +2 -0
  169. package/build/web/index.js.map +1 -0
  170. package/package.json +3 -1
  171. package/src/api/axios.ts +144 -0
  172. package/src/components/EnhancedCameraView.tsx +96 -78
  173. package/src/components/EnhancedCameraView.web.tsx +41 -40
  174. package/src/components/KYCElements/CountrySelectionTemplate.tsx +111 -136
  175. package/src/components/KYCElements/FileUploadTemplate.tsx +14 -8
  176. package/src/components/KYCElements/IDCardCapture.tsx +311 -115
  177. package/src/components/KYCElements/InitializationStep.tsx +53 -0
  178. package/src/components/KYCElements/LocationCaptureTemplate.tsx +17 -15
  179. package/src/components/KYCElements/OrientationVideoCapture.tsx +2 -2
  180. package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +2 -2
  181. package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +2 -2
  182. package/src/components/KYCElements/ReviewSubmitTemplate.tsx +201 -0
  183. package/src/components/KYCElements/SelfieCaptureTemplate.tsx +174 -57
  184. package/src/components/KYCElements/VerificationProgressTemplate.tsx +246 -0
  185. package/src/components/OverLay/IdCard.tsx +17 -9
  186. package/src/components/OverLay/SelfieOverlay.tsx +6 -5
  187. package/src/components/OverLay/type.ts +64 -2
  188. package/src/components/TemplateKYCExample.tsx +80 -200
  189. package/src/components/TemplateKYCFlowRefactored.tsx +80 -48
  190. package/src/components/example/OrientationVideoExample.tsx +3 -7
  191. package/src/config/countriesData.ts +84 -0
  192. package/src/config/region_mapping.ts +688 -0
  193. package/src/hooks/useI18n.ts +53 -0
  194. package/src/hooks/useOrientationVideo.ts +2 -2
  195. package/src/hooks/useRealtimeVerifier.ts +128 -0
  196. package/src/hooks/useTemplateKYCFlow.tsx +407 -57
  197. package/src/i18n/README.md +288 -0
  198. package/src/i18n/en/index.ts +206 -0
  199. package/src/i18n/fr/index.ts +205 -0
  200. package/src/i18n/index.ts +65 -0
  201. package/src/i18n/types.ts +172 -0
  202. package/src/i18n/usage-example.tsx +202 -0
  203. package/src/index.ts +3 -0
  204. package/src/modules/api/CardAuthentification.ts +114 -0
  205. package/src/modules/api/KYCService.ts +350 -30
  206. package/src/modules/api/SelfieVerification.ts +11 -0
  207. package/src/modules/api/backendApi.ts +8 -0
  208. package/src/modules/api/types.ts +51 -0
  209. package/src/types/KYC.types.ts +82 -14
  210. package/src/utils/cropByObb.ts +99 -0
  211. package/src/utils/get-document-type-info.ts +62 -0
  212. package/src/utils/pathToBase64.ts +47 -0
  213. package/src/utils/remove-duplicate.ts +3 -0
  214. package/src/web/WebKYCEntry.tsx +215 -0
  215. package/src/web/index.ts +1 -0
  216. 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
+ };