@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,205 @@
1
+ export const fr = {
2
+ // Common UI elements
3
+ common: {
4
+ next: 'Suivant',
5
+ previous: 'Précédent',
6
+ continue: 'Continuer',
7
+ cancel: 'Annuler',
8
+ confirm: 'Confirmer',
9
+ submit: 'Soumettre',
10
+ retry: 'Réessayer',
11
+ close: 'Fermer',
12
+ back: 'Retour',
13
+ loading: 'Chargement...',
14
+ error: 'Erreur',
15
+ success: 'Succès',
16
+ warning: 'Avertissement',
17
+ info: 'Information',
18
+ },
19
+
20
+ // KYC Flow
21
+ kyc: {
22
+ title: 'Vérification d\'Identité',
23
+ subtitle: 'Complétez votre vérification d\'identité pour continuer',
24
+ step: 'Étape %{current} sur %{total}',
25
+
26
+ // Initialization
27
+ initialization: {
28
+ title: 'Bienvenue dans la Vérification d\'Identité',
29
+ description: 'Nous devons vérifier votre identité pour respecter les réglementations et assurer la sécurité.',
30
+ startButton: 'Commencer la Vérification',
31
+ requirements: 'Ce dont vous aurez besoin :',
32
+ requirementsList: [
33
+ 'Une pièce d\'identité officielle valide',
34
+ 'Un bon éclairage pour les photos',
35
+ 'Une connexion internet stable'
36
+ ]
37
+ },
38
+
39
+ // Location Capture
40
+ locationCapture: {
41
+ title: 'Sécurisez Votre Vérification',
42
+ description: 'Autorisez l\'accès à la localisation pour nous aider à protéger votre compte et à prévenir les activités frauduleuses pendant la vérification.',
43
+ howThisHelps: 'Comment cela aide :',
44
+ howThisHelpsList: '• Vérifie que la localisation de votre appareil correspond à votre identité\n• Détecte et empêche les accès non autorisés\n• Garantit la conformité aux réglementations de sécurité',
45
+ permissionDeniedTitle: 'Permission refusée',
46
+ permissionDeniedMessage: 'La permission de localisation est nécessaire pour continuer.',
47
+ locationDisabledTitle: 'Localisation désactivée',
48
+ locationDisabledMessage: 'Veuillez activer la localisation sur votre appareil pour continuer.',
49
+ errorTitle: 'Erreur',
50
+ errorMessage: 'Impossible de récupérer votre localisation. Veuillez réessayer.',
51
+ obtained: 'Localisation obtenue',
52
+ latitudeLabel: 'Latitude',
53
+ longitudeLabel: 'Longitude',
54
+ accuracyLabel: 'Précision',
55
+ resetButton: 'Réinitialiser',
56
+ enableButton: 'Activer l\'accès à la localisation',
57
+ fetching: 'Récupération...'
58
+ },
59
+
60
+ // Country Selection
61
+ countrySelection: {
62
+ title: 'Sélectionnez Votre Pays',
63
+ subtitle: 'Choisissez le pays qui a émis votre document d\'identité',
64
+ searchPlaceholder: 'Recherchez votre pays...',
65
+ noResults: 'Aucun pays trouvé',
66
+ selectCountry: 'Sélectionner le Pays'
67
+ },
68
+
69
+ // ID Card Capture
70
+ idCardCapture: {
71
+ title: 'Capturez Votre Document d\'Identité',
72
+ subtitle: 'Prenez une photo claire de votre document d\'identité',
73
+ frontSide: 'Face Avant',
74
+ backSide: 'Face Arrière',
75
+ instructions: {
76
+ title: 'Instructions :',
77
+ list: [
78
+ 'Placez votre pièce d\'identité sur une surface plane',
79
+ 'Assurez-vous d\'un bon éclairage',
80
+ 'Gardez tout le document dans le cadre',
81
+ 'Évitez les reflets et les ombres'
82
+ ]
83
+ },
84
+ captureButton: 'Prendre la Photo',
85
+ retakeButton: 'Reprendre',
86
+ usePhotoButton: 'Utiliser Cette Photo',
87
+ processing: 'Traitement de l\'image...',
88
+ success: 'Document d\'identité capturé avec succès',
89
+ error: 'Échec de la capture du document. Veuillez réessayer.'
90
+ },
91
+
92
+ // Selfie Capture
93
+ selfieCapture: {
94
+ title: 'Prenez un Selfie',
95
+ subtitle: 'Prenez un selfie clair pour la vérification d\'identité',
96
+ instructions: {
97
+ title: 'Instructions :',
98
+ list: [
99
+ 'Regardez directement la caméra',
100
+ 'Assurez-vous d\'un bon éclairage sur votre visage',
101
+ 'Retirez les lunettes et les chapeaux',
102
+ 'Gardez une expression neutre'
103
+ ]
104
+ },
105
+ captureButton: 'Prendre le Selfie',
106
+ retakeButton: 'Reprendre',
107
+ usePhotoButton: 'Utiliser Cette Photo',
108
+ processing: 'Traitement du selfie...',
109
+ success: 'Selfie capturé avec succès',
110
+ error: 'Échec de la capture du selfie. Veuillez réessayer.'
111
+ },
112
+
113
+ // File Upload
114
+ fileUpload: {
115
+ title: 'Télécharger le Document',
116
+ subtitle: 'Téléchargez une photo claire de votre document',
117
+ selectFile: 'Sélectionner le Fichier',
118
+ uploadButton: 'Télécharger',
119
+ dragDropText: 'Glissez-déposez votre fichier ici, ou cliquez pour sélectionner',
120
+ supportedFormats: 'Formats supportés : JPG, PNG, PDF',
121
+ maxSize: 'Taille maximale : 10MB',
122
+ processing: 'Traitement du fichier...',
123
+ success: 'Fichier téléchargé avec succès',
124
+ error: 'Échec du téléchargement. Veuillez réessayer.'
125
+ },
126
+
127
+ // Verification Progress
128
+ verificationProgress: {
129
+ title: 'Vérification de Votre Identité',
130
+ subtitle: 'Veuillez patienter pendant que nous vérifions vos informations',
131
+ steps: {
132
+ analyzing: 'Analyse des documents...',
133
+ extracting: 'Extraction des informations...',
134
+ verifying: 'Vérification de l\'identité...',
135
+ complete: 'Vérification terminée'
136
+ },
137
+ estimatedTime: 'Temps estimé : 2-3 minutes',
138
+ status: {
139
+ pending: 'En attente',
140
+ processing: 'En cours',
141
+ completed: 'Terminé',
142
+ failed: 'Échoué'
143
+ }
144
+ },
145
+
146
+ // Review and Submit
147
+ reviewSubmit: {
148
+ title: 'Vérifiez Vos Informations',
149
+ subtitle: 'Veuillez vérifier les informations que nous avons extraites',
150
+ personalInfo: 'Informations Personnelles',
151
+ documentInfo: 'Informations du Document',
152
+ editButton: 'Modifier',
153
+ submitButton: 'Soumettre pour Vérification',
154
+ confirmMessage: 'Êtes-vous sûr de vouloir soumettre ces informations ?',
155
+ processing: 'Soumission...',
156
+ success: 'Informations soumises avec succès',
157
+ error: 'Échec de la soumission. Veuillez réessayer.'
158
+ }
159
+ },
160
+
161
+ // Camera and Media
162
+ camera: {
163
+ permissionTitle: 'Permission Caméra Requise',
164
+ permissionMessage: 'Nous avons besoin d\'accéder à votre caméra pour capturer votre pièce d\'identité et votre selfie.',
165
+ permissionButton: 'Accorder la Permission',
166
+ settingsButton: 'Ouvrir les Paramètres',
167
+ notAvailable: 'Caméra non disponible',
168
+ switchCamera: 'Changer de Caméra',
169
+ flashOn: 'Flash Activé',
170
+ flashOff: 'Flash Désactivé',
171
+ capturePhoto: 'Prendre la Photo',
172
+ processing: 'Traitement...',
173
+ permissionRequired: 'Permission caméra requise. Veuillez accorder la permission pour continuer.',
174
+ deviceNotAvailable: 'Appareil photo non disponible',
175
+ notReady: 'Caméra pas prête',
176
+ analyzing: 'Analyse en cours...',
177
+ errorOccurred: 'Erreur de caméra survenue',
178
+ failedToCapture: 'Échec de la capture photo',
179
+ failedToStartRecording: 'Échec du démarrage de l\'enregistrement vidéo',
180
+ failedToStopRecording: 'Échec de l\'arrêt de l\'enregistrement vidéo'
181
+ },
182
+
183
+ // Errors
184
+ errors: {
185
+ networkError: 'Erreur réseau. Veuillez vérifier votre connexion.',
186
+ serverError: 'Erreur serveur. Veuillez réessayer plus tard.',
187
+ validationError: 'Veuillez vérifier vos informations et réessayer.',
188
+ cameraError: 'Erreur caméra. Veuillez réessayer.',
189
+ fileError: 'Erreur fichier. Veuillez réessayer.',
190
+ timeoutError: 'Délai d\'attente dépassé. Veuillez réessayer.',
191
+ unknownError: 'Une erreur inconnue s\'est produite. Veuillez réessayer.'
192
+ },
193
+
194
+ validation: {
195
+ required: 'Ce champ est obligatoire',
196
+ invalidEmail: 'Veuillez entrer une adresse email valide',
197
+ invalidPhone: 'Veuillez entrer un numéro de téléphone valide',
198
+ invalidDate: 'Veuillez entrer une date valide',
199
+ minLength: 'Doit contenir au moins {min} caractères',
200
+ maxLength: 'Ne doit pas dépasser {max} caractères',
201
+ invalidFormat: 'Format invalide',
202
+ fileTooLarge: 'Fichier trop volumineux',
203
+ fileTypeNotSupported: 'Type de fichier non supporté'
204
+ }
205
+ };
@@ -0,0 +1,65 @@
1
+ import { I18n } from 'i18n-js';
2
+ import { en } from './en';
3
+ import { fr } from './fr';
4
+
5
+ // Create i18n instance
6
+ const i18n = new I18n();
7
+
8
+ // Set translations
9
+ i18n.translations = {
10
+ en,
11
+ fr,
12
+ };
13
+
14
+ // Set default locale
15
+ i18n.defaultLocale = 'en';
16
+
17
+ // Set current locale
18
+ i18n.locale = 'en';
19
+
20
+ // Enable fallback to default locale
21
+ i18n.enableFallback = true;
22
+
23
+ // Configure pluralization rules
24
+ i18n.pluralization = {
25
+ en: (count: number) => {
26
+ if (count === 1) return 'one';
27
+ return 'other';
28
+ },
29
+ fr: (count: number) => {
30
+ if (count === 0 || count === 1) return 'one';
31
+ return 'other';
32
+ },
33
+ } as any;
34
+
35
+ // Helper function to set locale
36
+ export const setLocale = (locale: string) => {
37
+ if (i18n.translations[locale]) {
38
+ i18n.locale = locale;
39
+ } else {
40
+ console.warn(`Locale '${locale}' not found. Falling back to default locale.`);
41
+ i18n.locale = i18n.defaultLocale;
42
+ }
43
+ };
44
+
45
+ // Helper function to get current locale
46
+ export const getCurrentLocale = () => i18n.locale;
47
+
48
+ // Helper function to get available locales
49
+ export const getAvailableLocales = () => Object.keys(i18n.translations);
50
+
51
+ // Helper function to translate with interpolation
52
+ export const translate = (key: string, options?: any) => {
53
+ return i18n.t(key, options);
54
+ };
55
+
56
+ // Helper function to translate with pluralization
57
+ export const translatePlural = (key: string, count: number, options?: any) => {
58
+ return i18n.t(key, { count, ...options });
59
+ };
60
+
61
+ // Export the i18n instance
62
+ export { i18n };
63
+
64
+ // Export default
65
+ export default i18n;
@@ -0,0 +1,172 @@
1
+ // Type definitions for i18n translations
2
+
3
+ export interface CommonTranslations {
4
+ next: string;
5
+ previous: string;
6
+ continue: string;
7
+ cancel: string;
8
+ confirm: string;
9
+ submit: string;
10
+ retry: string;
11
+ close: string;
12
+ back: string;
13
+ loading: string;
14
+ error: string;
15
+ success: string;
16
+ warning: string;
17
+ info: string;
18
+ }
19
+
20
+ export interface KYCTranslations {
21
+ title: string;
22
+ subtitle: string;
23
+ step: string;
24
+
25
+ initialization: {
26
+ title: string;
27
+ description: string;
28
+ startButton: string;
29
+ requirements: string;
30
+ requirementsList: string[];
31
+ };
32
+
33
+ countrySelection: {
34
+ title: string;
35
+ subtitle: string;
36
+ searchPlaceholder: string;
37
+ noResults: string;
38
+ selectCountry: string;
39
+ };
40
+
41
+ idCardCapture: {
42
+ title: string;
43
+ subtitle: string;
44
+ frontSide: string;
45
+ backSide: string;
46
+ instructions: {
47
+ title: string;
48
+ list: string[];
49
+ };
50
+ captureButton: string;
51
+ retakeButton: string;
52
+ usePhotoButton: string;
53
+ processing: string;
54
+ success: string;
55
+ error: string;
56
+ };
57
+
58
+ selfieCapture: {
59
+ title: string;
60
+ subtitle: string;
61
+ instructions: {
62
+ title: string;
63
+ list: string[];
64
+ };
65
+ captureButton: string;
66
+ retakeButton: string;
67
+ usePhotoButton: string;
68
+ processing: string;
69
+ success: string;
70
+ error: string;
71
+ };
72
+
73
+ fileUpload: {
74
+ title: string;
75
+ subtitle: string;
76
+ selectFile: string;
77
+ uploadButton: string;
78
+ dragDropText: string;
79
+ supportedFormats: string;
80
+ maxSize: string;
81
+ processing: string;
82
+ success: string;
83
+ error: string;
84
+ };
85
+
86
+ verificationProgress: {
87
+ title: string;
88
+ subtitle: string;
89
+ steps: {
90
+ analyzing: string;
91
+ extracting: string;
92
+ verifying: string;
93
+ complete: string;
94
+ };
95
+ estimatedTime: string;
96
+ status: {
97
+ pending: string;
98
+ processing: string;
99
+ completed: string;
100
+ failed: string;
101
+ };
102
+ };
103
+
104
+ reviewSubmit: {
105
+ title: string;
106
+ subtitle: string;
107
+ personalInfo: string;
108
+ documentInfo: string;
109
+ editButton: string;
110
+ submitButton: string;
111
+ confirmMessage: string;
112
+ processing: string;
113
+ success: string;
114
+ error: string;
115
+ };
116
+ }
117
+
118
+ export interface CameraTranslations {
119
+ permissionTitle: string;
120
+ permissionMessage: string;
121
+ permissionButton: string;
122
+ settingsButton: string;
123
+ notAvailable: string;
124
+ switchCamera: string;
125
+ flashOn: string;
126
+ flashOff: string;
127
+ capturePhoto: string;
128
+ processing: string;
129
+ }
130
+
131
+ export interface ErrorTranslations {
132
+ networkError: string;
133
+ serverError: string;
134
+ validationError: string;
135
+ cameraError: string;
136
+ fileError: string;
137
+ timeoutError: string;
138
+ unknownError: string;
139
+ }
140
+
141
+ export interface ValidationTranslations {
142
+ required: string;
143
+ invalidEmail: string;
144
+ invalidPhone: string;
145
+ invalidDate: string;
146
+ minLength: string;
147
+ maxLength: string;
148
+ invalidFormat: string;
149
+ fileTooLarge: string;
150
+ fileTypeNotSupported: string;
151
+ }
152
+
153
+ export interface TranslationKeys {
154
+ common: CommonTranslations;
155
+ kyc: KYCTranslations;
156
+ camera: CameraTranslations;
157
+ errors: ErrorTranslations;
158
+ validation: ValidationTranslations;
159
+ }
160
+
161
+ // Type for supported locales
162
+ export type SupportedLocale = 'en' | 'fr';
163
+
164
+ // Type for translation function parameters
165
+ export interface TranslationOptions {
166
+ [key: string]: any;
167
+ }
168
+
169
+ // Type for pluralization options
170
+ export interface PluralizationOptions extends TranslationOptions {
171
+ count: number;
172
+ }
@@ -0,0 +1,202 @@
1
+ import React from 'react';
2
+ import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
3
+ import { useI18n } from '../hooks/useI18n';
4
+
5
+ // Exemple d'utilisation du système i18n dans votre application
6
+ export const KYCFlowWithI18n: React.FC = () => {
7
+ const { t, locale, setLocale, availableLocales } = useI18n();
8
+
9
+
10
+
11
+ return (
12
+ <View style={styles.container}>
13
+ {/* Sélecteur de langue */}
14
+ <View style={styles.languageSelector}>
15
+ <Text style={styles.languageLabel}>{t('kyc.countrySelection.title')}</Text>
16
+ <View style={styles.languageButtons}>
17
+ {availableLocales.map((loc) => (
18
+ <TouchableOpacity
19
+ key={loc}
20
+ style={[
21
+ styles.languageButton,
22
+ locale === loc && styles.activeLanguageButton
23
+ ]}
24
+ onPress={() => setLocale(loc)}
25
+ >
26
+ <Text style={[
27
+ styles.languageButtonText,
28
+ locale === loc && styles.activeLanguageButtonText
29
+ ]}>
30
+ {loc.toUpperCase()}
31
+ </Text>
32
+ </TouchableOpacity>
33
+ ))}
34
+ </View>
35
+ </View>
36
+
37
+ {/* Titre principal */}
38
+ <Text style={styles.title}>{t('kyc.title')}</Text>
39
+ <Text style={styles.subtitle}>{t('kyc.subtitle')}</Text>
40
+
41
+ {/* Boutons d'action */}
42
+ <View style={styles.buttonContainer}>
43
+ <TouchableOpacity style={styles.primaryButton}>
44
+ <Text style={styles.primaryButtonText}>
45
+ {t('kyc.initialization.startButton')}
46
+ </Text>
47
+ </TouchableOpacity>
48
+
49
+ <TouchableOpacity style={styles.secondaryButton}>
50
+ <Text style={styles.secondaryButtonText}>
51
+ {t('common.cancel')}
52
+ </Text>
53
+ </TouchableOpacity>
54
+ </View>
55
+
56
+ {/* Instructions */}
57
+ <View style={styles.instructionsContainer}>
58
+ <Text style={styles.instructionsTitle}>
59
+ {t('kyc.initialization.requirements')}
60
+ </Text>
61
+ {/* {t('kyc.initialization.requirementsList').map((requirement: string, index: number) => (
62
+ <Text key={index} style={styles.requirementItem}>
63
+ • {requirement}
64
+ </Text>
65
+ ))} */}
66
+ </View>
67
+
68
+ {/* Exemple d'utilisation avec interpolation */}
69
+ <Text style={styles.stepText}>
70
+ {t('kyc.step', { current: 1, total: 3 })}
71
+ </Text>
72
+
73
+ {/* Exemple d'utilisation avec pluralisation */}
74
+ <Text style={styles.countText}>
75
+ {t('kyc.verificationProgress.estimatedTime')}
76
+ </Text>
77
+ </View>
78
+ );
79
+ };
80
+
81
+ const styles = StyleSheet.create({
82
+ container: {
83
+ flex: 1,
84
+ padding: 20,
85
+ backgroundColor: '#FFFFFF',
86
+ },
87
+ languageSelector: {
88
+ flexDirection: 'row',
89
+ alignItems: 'center',
90
+ justifyContent: 'space-between',
91
+ marginBottom: 20,
92
+ paddingVertical: 10,
93
+ borderBottomWidth: 1,
94
+ borderBottomColor: '#E0E0E0',
95
+ },
96
+ languageLabel: {
97
+ fontSize: 16,
98
+ fontWeight: '600',
99
+ color: '#333333',
100
+ },
101
+ languageButtons: {
102
+ flexDirection: 'row',
103
+ gap: 10,
104
+ },
105
+ languageButton: {
106
+ paddingHorizontal: 16,
107
+ paddingVertical: 8,
108
+ borderRadius: 20,
109
+ backgroundColor: '#F5F5F5',
110
+ borderWidth: 1,
111
+ borderColor: '#E0E0E0',
112
+ },
113
+ activeLanguageButton: {
114
+ backgroundColor: '#007AFF',
115
+ borderColor: '#007AFF',
116
+ },
117
+ languageButtonText: {
118
+ fontSize: 14,
119
+ fontWeight: '500',
120
+ color: '#666666',
121
+ },
122
+ activeLanguageButtonText: {
123
+ color: '#FFFFFF',
124
+ },
125
+ title: {
126
+ fontSize: 28,
127
+ fontWeight: 'bold',
128
+ textAlign: 'center',
129
+ marginBottom: 10,
130
+ color: '#333333',
131
+ },
132
+ subtitle: {
133
+ fontSize: 16,
134
+ textAlign: 'center',
135
+ marginBottom: 30,
136
+ color: '#666666',
137
+ lineHeight: 22,
138
+ },
139
+ buttonContainer: {
140
+ gap: 15,
141
+ marginBottom: 30,
142
+ },
143
+ primaryButton: {
144
+ backgroundColor: '#007AFF',
145
+ paddingVertical: 15,
146
+ paddingHorizontal: 30,
147
+ borderRadius: 8,
148
+ alignItems: 'center',
149
+ },
150
+ primaryButtonText: {
151
+ color: '#FFFFFF',
152
+ fontSize: 16,
153
+ fontWeight: '600',
154
+ },
155
+ secondaryButton: {
156
+ backgroundColor: 'transparent',
157
+ paddingVertical: 15,
158
+ paddingHorizontal: 30,
159
+ borderRadius: 8,
160
+ alignItems: 'center',
161
+ borderWidth: 1,
162
+ borderColor: '#E0E0E0',
163
+ },
164
+ secondaryButtonText: {
165
+ color: '#666666',
166
+ fontSize: 16,
167
+ fontWeight: '500',
168
+ },
169
+ instructionsContainer: {
170
+ backgroundColor: '#F8F9FA',
171
+ padding: 20,
172
+ borderRadius: 10,
173
+ marginBottom: 20,
174
+ },
175
+ instructionsTitle: {
176
+ fontSize: 16,
177
+ fontWeight: '600',
178
+ marginBottom: 15,
179
+ color: '#333333',
180
+ },
181
+ requirementItem: {
182
+ fontSize: 14,
183
+ marginBottom: 8,
184
+ color: '#666666',
185
+ lineHeight: 20,
186
+ },
187
+ stepText: {
188
+ fontSize: 14,
189
+ textAlign: 'center',
190
+ color: '#007AFF',
191
+ fontWeight: '500',
192
+ marginBottom: 10,
193
+ },
194
+ countText: {
195
+ fontSize: 12,
196
+ textAlign: 'center',
197
+ color: '#999999',
198
+ fontStyle: 'italic',
199
+ },
200
+ });
201
+
202
+ export default KYCFlowWithI18n;
package/src/index.ts CHANGED
@@ -42,6 +42,9 @@ export { FileUploadTemplate } from './components/KYCElements/FileUploadTemplate'
42
42
  export { LocationCaptureTemplate } from './components/KYCElements/LocationCaptureTemplate';
43
43
  export { CountrySelectionTemplate } from './components/KYCElements/CountrySelectionTemplate';
44
44
 
45
+ // Export Web KYC Components
46
+ export { WebKYCEntry } from './web';
47
+
45
48
  // Export KYC Service
46
49
  export { default as KYCService } from './modules/api/KYCService';
47
50