@didit-protocol/sdk-web 0.1.6 → 0.1.8

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Didit SDK for Web v0.1.6
2
+ * Didit SDK for Web v0.1.8
3
3
  * (c) 2026 Didit
4
4
  * @license MIT
5
5
  */
@@ -22,7 +22,58 @@ const CSS_CLASSES = {
22
22
  confirmBox: "didit-confirm-box",
23
23
  embedded: "didit-embedded"
24
24
  };
25
- const SDK_VERSION = "0.1.6";
25
+ const SDK_VERSION = "0.1.8";
26
+ const languages = [
27
+ "ar",
28
+ "bg",
29
+ "bn",
30
+ "ca",
31
+ "cnr",
32
+ "cs",
33
+ "da",
34
+ "de",
35
+ "el",
36
+ "en",
37
+ "es",
38
+ "et",
39
+ "fa",
40
+ "fi",
41
+ "fr",
42
+ "he",
43
+ "hi",
44
+ "hr",
45
+ "hu",
46
+ "hy",
47
+ "id",
48
+ "it",
49
+ "ja",
50
+ "ka",
51
+ "ko",
52
+ "lt",
53
+ "lv",
54
+ "mk",
55
+ "ms",
56
+ "nl",
57
+ "no",
58
+ "pl",
59
+ "pt-BR",
60
+ "pt",
61
+ "ro",
62
+ "ru",
63
+ "sk",
64
+ "sl",
65
+ "so",
66
+ "sr",
67
+ "sv",
68
+ "th",
69
+ "tr",
70
+ "uk",
71
+ "uz",
72
+ "vi",
73
+ "zh-CN",
74
+ "zh-TW",
75
+ "zh",
76
+ ];
26
77
 
27
78
  class SDKLogger {
28
79
  static get isEnabled() {
@@ -54,7 +105,7 @@ function generateModalId() {
54
105
  function isAllowedOrigin(origin) {
55
106
  try {
56
107
  const url = new URL(origin);
57
- return url.hostname.endsWith('.didit.me');
108
+ return url.hostname.endsWith(".didit.me");
58
109
  }
59
110
  catch {
60
111
  return false;
@@ -72,6 +123,424 @@ function createVerificationError(type, customMessage) {
72
123
  message: customMessage || messages[type]
73
124
  };
74
125
  }
126
+ function detectLanguageFromUrl(url) {
127
+ try {
128
+ const { pathname } = new URL(url);
129
+ const firstSegment = pathname.split("/").filter(Boolean)[0];
130
+ if (firstSegment && languages.includes(firstSegment)) {
131
+ return firstSegment;
132
+ }
133
+ }
134
+ catch {
135
+ // we get it from the browser
136
+ }
137
+ const browserLang = navigator.language;
138
+ if (languages.includes(browserLang))
139
+ return browserLang;
140
+ const baseLang = browserLang.split("-")[0];
141
+ if (languages.includes(baseLang))
142
+ return baseLang;
143
+ return "en";
144
+ }
145
+
146
+ const EN = {
147
+ exitTitle: "Exit verification?",
148
+ exitMessage: "Exiting will end your verification process. Are you sure?",
149
+ continueButton: "Continue",
150
+ exitButton: "Exit",
151
+ ariaLabelModal: "Didit Verification",
152
+ ariaLabelClose: "Close verification"
153
+ };
154
+ const translationsMap = {
155
+ ar: {
156
+ exitTitle: "الخروج من التحقق؟",
157
+ exitMessage: "سيؤدي الخروج إلى إنهاء عملية التحقق الخاصة بك. هل أنت متأكد؟",
158
+ continueButton: "متابعة",
159
+ exitButton: "خروج",
160
+ ariaLabelModal: "التحقق من Didit",
161
+ ariaLabelClose: "إغلاق التحقق"
162
+ },
163
+ bg: {
164
+ exitTitle: "Излизане от верификацията?",
165
+ exitMessage: "Излизането ще прекрати процеса на верификация. Сигурни ли сте?",
166
+ continueButton: "Продължи",
167
+ exitButton: "Изход",
168
+ ariaLabelModal: "Верификация Didit",
169
+ ariaLabelClose: "Затваряне на верификацията"
170
+ },
171
+ bn: {
172
+ exitTitle: "যাচাইকরণ থেকে বের হবেন?",
173
+ exitMessage: "বের হলে আপনার যাচাইকরণ প্রক্রিয়া শেষ হয়ে যাবে। আপনি কি নিশ্চিত?",
174
+ continueButton: "চালিয়ে যান",
175
+ exitButton: "বের হন",
176
+ ariaLabelModal: "Didit যাচাইকরণ",
177
+ ariaLabelClose: "যাচাইকরণ বন্ধ করুন"
178
+ },
179
+ ca: {
180
+ exitTitle: "Sortir de la verificació?",
181
+ exitMessage: "Sortir finalitzarà el procés de verificació. N'esteu segur?",
182
+ continueButton: "Continua",
183
+ exitButton: "Sortir",
184
+ ariaLabelModal: "Verificació Didit",
185
+ ariaLabelClose: "Tancar verificació"
186
+ },
187
+ cnr: {
188
+ exitTitle: "Izaći iz verifikacije?",
189
+ exitMessage: "Izlaskom ćete prekinuti proces verifikacije. Jeste li sigurni?",
190
+ continueButton: "Nastavi",
191
+ exitButton: "Izađi",
192
+ ariaLabelModal: "Didit verifikacija",
193
+ ariaLabelClose: "Zatvori verifikaciju"
194
+ },
195
+ cs: {
196
+ exitTitle: "Opustit ověření?",
197
+ exitMessage: "Odchodem ukončíte proces ověření. Jste si jisti?",
198
+ continueButton: "Pokračovat",
199
+ exitButton: "Odejít",
200
+ ariaLabelModal: "Ověření Didit",
201
+ ariaLabelClose: "Zavřít ověření"
202
+ },
203
+ da: {
204
+ exitTitle: "Forlad verifikation?",
205
+ exitMessage: "Hvis du forlader, afsluttes din verifikationsproces. Er du sikker?",
206
+ continueButton: "Fortsæt",
207
+ exitButton: "Forlad",
208
+ ariaLabelModal: "Didit-verifikation",
209
+ ariaLabelClose: "Luk verifikation"
210
+ },
211
+ de: {
212
+ exitTitle: "Verifizierung verlassen?",
213
+ exitMessage: "Das Verlassen beendet Ihren Verifizierungsprozess. Sind Sie sicher?",
214
+ continueButton: "Fortfahren",
215
+ exitButton: "Verlassen",
216
+ ariaLabelModal: "Didit-Verifizierung",
217
+ ariaLabelClose: "Verifizierung schließen"
218
+ },
219
+ el: {
220
+ exitTitle: "Έξοδος από την επαλήθευση;",
221
+ exitMessage: "Η έξοδος θα τερματίσει τη διαδικασία επαλήθευσης. Είστε σίγουροι;",
222
+ continueButton: "Συνέχεια",
223
+ exitButton: "Έξοδος",
224
+ ariaLabelModal: "Επαλήθευση Didit",
225
+ ariaLabelClose: "Κλείσιμο επαλήθευσης"
226
+ },
227
+ en: EN,
228
+ es: {
229
+ exitTitle: "¿Salir de la verificación?",
230
+ exitMessage: "Salir terminará tu proceso de verificación. ¿Estás seguro?",
231
+ continueButton: "Continuar",
232
+ exitButton: "Salir",
233
+ ariaLabelModal: "Verificación Didit",
234
+ ariaLabelClose: "Cerrar verificación"
235
+ },
236
+ et: {
237
+ exitTitle: "Lahkuda kinnitamisest?",
238
+ exitMessage: "Lahkumine lõpetab teie kinnitamisprotsessi. Kas olete kindel?",
239
+ continueButton: "Jätka",
240
+ exitButton: "Lahku",
241
+ ariaLabelModal: "Didit kinnitus",
242
+ ariaLabelClose: "Sulge kinnitus"
243
+ },
244
+ fa: {
245
+ exitTitle: "خروج از تأیید هویت؟",
246
+ exitMessage: "خروج باعث پایان فرآیند تأیید هویت شما می‌شود. آیا مطمئن هستید؟",
247
+ continueButton: "ادامه",
248
+ exitButton: "خروج",
249
+ ariaLabelModal: "تأیید هویت Didit",
250
+ ariaLabelClose: "بستن تأیید هویت"
251
+ },
252
+ fi: {
253
+ exitTitle: "Poistu vahvistuksesta?",
254
+ exitMessage: "Poistuminen päättää vahvistusprosessisi. Oletko varma?",
255
+ continueButton: "Jatka",
256
+ exitButton: "Poistu",
257
+ ariaLabelModal: "Didit-vahvistus",
258
+ ariaLabelClose: "Sulje vahvistus"
259
+ },
260
+ fr: {
261
+ exitTitle: "Quitter la vérification ?",
262
+ exitMessage: "Quitter mettra fin à votre processus de vérification. Êtes-vous sûr ?",
263
+ continueButton: "Continuer",
264
+ exitButton: "Quitter",
265
+ ariaLabelModal: "Vérification Didit",
266
+ ariaLabelClose: "Fermer la vérification"
267
+ },
268
+ he: {
269
+ exitTitle: "לצאת מהאימות?",
270
+ exitMessage: "יציאה תסיים את תהליך האימות שלך. האם אתה בטוח?",
271
+ continueButton: "המשך",
272
+ exitButton: "יציאה",
273
+ ariaLabelModal: "אימות Didit",
274
+ ariaLabelClose: "סגירת אימות"
275
+ },
276
+ hi: {
277
+ exitTitle: "सत्यापन से बाहर निकलें?",
278
+ exitMessage: "बाहर निकलने से आपकी सत्यापन प्रक्रिया समाप्त हो जाएगी। क्या आप सुनिश्चित हैं?",
279
+ continueButton: "जारी रखें",
280
+ exitButton: "बाहर निकलें",
281
+ ariaLabelModal: "Didit सत्यापन",
282
+ ariaLabelClose: "सत्यापन बंद करें"
283
+ },
284
+ hr: {
285
+ exitTitle: "Izaći iz verifikacije?",
286
+ exitMessage: "Izlaskom ćete prekinuti proces verifikacije. Jeste li sigurni?",
287
+ continueButton: "Nastavi",
288
+ exitButton: "Izađi",
289
+ ariaLabelModal: "Didit verifikacija",
290
+ ariaLabelClose: "Zatvori verifikaciju"
291
+ },
292
+ hu: {
293
+ exitTitle: "Kilépés az ellenőrzésből?",
294
+ exitMessage: "A kilépés befejezi az ellenőrzési folyamatot. Biztos benne?",
295
+ continueButton: "Folytatás",
296
+ exitButton: "Kilépés",
297
+ ariaLabelModal: "Didit ellenőrzés",
298
+ ariaLabelClose: "Ellenőrzés bezárása"
299
+ },
300
+ hy: {
301
+ exitTitle: "Դուրս գա՞լ ստուգումից",
302
+ exitMessage: "Դուրս գալը կավարտի ձեր ստուգման գործընթացը։ Համոզված ե՞ք?",
303
+ continueButton: "Շարունակել",
304
+ exitButton: "Դուրս գալ",
305
+ ariaLabelModal: "Didit ստուգում",
306
+ ariaLabelClose: "Փակել ստուգումը"
307
+ },
308
+ id: {
309
+ exitTitle: "Keluar dari verifikasi?",
310
+ exitMessage: "Keluar akan mengakhiri proses verifikasi Anda. Apakah Anda yakin?",
311
+ continueButton: "Lanjutkan",
312
+ exitButton: "Keluar",
313
+ ariaLabelModal: "Verifikasi Didit",
314
+ ariaLabelClose: "Tutup verifikasi"
315
+ },
316
+ it: {
317
+ exitTitle: "Uscire dalla verifica?",
318
+ exitMessage: "L'uscita terminerà il processo di verifica. Sei sicuro?",
319
+ continueButton: "Continua",
320
+ exitButton: "Esci",
321
+ ariaLabelModal: "Verifica Didit",
322
+ ariaLabelClose: "Chiudi verifica"
323
+ },
324
+ ja: {
325
+ exitTitle: "認証を終了しますか?",
326
+ exitMessage: "終了すると認証プロセスが中断されます。よろしいですか?",
327
+ continueButton: "続ける",
328
+ exitButton: "終了",
329
+ ariaLabelModal: "Didit 認証",
330
+ ariaLabelClose: "認証を閉じる"
331
+ },
332
+ ka: {
333
+ exitTitle: "გამოსვლა შემოწმებიდან?",
334
+ exitMessage: "გამოსვლა დაასრულებს თქვენს შემოწმების პროცესს. დარწმუნებული ხართ?",
335
+ continueButton: "გაგრძელება",
336
+ exitButton: "გამოსვლა",
337
+ ariaLabelModal: "Didit შემოწმება",
338
+ ariaLabelClose: "შემოწმების დახურვა"
339
+ },
340
+ ko: {
341
+ exitTitle: "인증을 종료하시겠습니까?",
342
+ exitMessage: "종료하면 인증 절차가 중단됩니다. 확실하십니까?",
343
+ continueButton: "계속",
344
+ exitButton: "종료",
345
+ ariaLabelModal: "Didit 인증",
346
+ ariaLabelClose: "인증 닫기"
347
+ },
348
+ lt: {
349
+ exitTitle: "Išeiti iš patvirtinimo?",
350
+ exitMessage: "Išėjimas nutrauks jūsų patvirtinimo procesą. Ar esate tikri?",
351
+ continueButton: "Tęsti",
352
+ exitButton: "Išeiti",
353
+ ariaLabelModal: "Didit patvirtinimas",
354
+ ariaLabelClose: "Uždaryti patvirtinimą"
355
+ },
356
+ lv: {
357
+ exitTitle: "Iziet no verifikācijas?",
358
+ exitMessage: "Iziešana pārtrauks jūsu verifikācijas procesu. Vai esat pārliecināts?",
359
+ continueButton: "Turpināt",
360
+ exitButton: "Iziet",
361
+ ariaLabelModal: "Didit verifikācija",
362
+ ariaLabelClose: "Aizvērt verifikāciju"
363
+ },
364
+ mk: {
365
+ exitTitle: "Излези од верификацијата?",
366
+ exitMessage: "Излегувањето ќе го прекине процесот на верификација. Дали сте сигурни?",
367
+ continueButton: "Продолжи",
368
+ exitButton: "Излези",
369
+ ariaLabelModal: "Верификација Didit",
370
+ ariaLabelClose: "Затвори верификација"
371
+ },
372
+ ms: {
373
+ exitTitle: "Keluar dari pengesahan?",
374
+ exitMessage: "Keluar akan menamatkan proses pengesahan anda. Adakah anda pasti?",
375
+ continueButton: "Teruskan",
376
+ exitButton: "Keluar",
377
+ ariaLabelModal: "Pengesahan Didit",
378
+ ariaLabelClose: "Tutup pengesahan"
379
+ },
380
+ nl: {
381
+ exitTitle: "Verificatie verlaten?",
382
+ exitMessage: "Verlaten beëindigt uw verificatieproces. Weet u het zeker?",
383
+ continueButton: "Doorgaan",
384
+ exitButton: "Verlaten",
385
+ ariaLabelModal: "Didit-verificatie",
386
+ ariaLabelClose: "Verificatie sluiten"
387
+ },
388
+ no: {
389
+ exitTitle: "Forlat verifisering?",
390
+ exitMessage: "Å forlate vil avslutte verifiseringsprosessen. Er du sikker?",
391
+ continueButton: "Fortsett",
392
+ exitButton: "Forlat",
393
+ ariaLabelModal: "Didit-verifisering",
394
+ ariaLabelClose: "Lukk verifisering"
395
+ },
396
+ pl: {
397
+ exitTitle: "Czy wyjść z weryfikacji?",
398
+ exitMessage: "Wyjście zakończy proces weryfikacji. Czy na pewno?",
399
+ continueButton: "Kontynuuj",
400
+ exitButton: "Wyjdź",
401
+ ariaLabelModal: "Weryfikacja Didit",
402
+ ariaLabelClose: "Zamknij weryfikację"
403
+ },
404
+ "pt-BR": {
405
+ exitTitle: "Sair da verificação?",
406
+ exitMessage: "Sair encerrará seu processo de verificação. Tem certeza?",
407
+ continueButton: "Continuar",
408
+ exitButton: "Sair",
409
+ ariaLabelModal: "Verificação Didit",
410
+ ariaLabelClose: "Fechar verificação"
411
+ },
412
+ pt: {
413
+ exitTitle: "Sair da verificação?",
414
+ exitMessage: "Sair terminará o seu processo de verificação. Tem a certeza?",
415
+ continueButton: "Continuar",
416
+ exitButton: "Sair",
417
+ ariaLabelModal: "Verificação Didit",
418
+ ariaLabelClose: "Fechar verificação"
419
+ },
420
+ ro: {
421
+ exitTitle: "Ieși din verificare?",
422
+ exitMessage: "Ieșirea va încheia procesul de verificare. Ești sigur?",
423
+ continueButton: "Continuă",
424
+ exitButton: "Ieși",
425
+ ariaLabelModal: "Verificare Didit",
426
+ ariaLabelClose: "Închide verificarea"
427
+ },
428
+ ru: {
429
+ exitTitle: "Выйти из верификации?",
430
+ exitMessage: "Выход завершит процесс верификации. Вы уверены?",
431
+ continueButton: "Продолжить",
432
+ exitButton: "Выйти",
433
+ ariaLabelModal: "Верификация Didit",
434
+ ariaLabelClose: "Закрыть верификацию"
435
+ },
436
+ sk: {
437
+ exitTitle: "Opustiť overenie?",
438
+ exitMessage: "Odchodom ukončíte proces overenia. Ste si istí?",
439
+ continueButton: "Pokračovať",
440
+ exitButton: "Odísť",
441
+ ariaLabelModal: "Overenie Didit",
442
+ ariaLabelClose: "Zavrieť overenie"
443
+ },
444
+ sl: {
445
+ exitTitle: "Zapustiti preverjanje?",
446
+ exitMessage: "Izhod bo prekinil postopek preverjanja. Ali ste prepričani?",
447
+ continueButton: "Nadaljuj",
448
+ exitButton: "Izhod",
449
+ ariaLabelModal: "Preverjanje Didit",
450
+ ariaLabelClose: "Zapri preverjanje"
451
+ },
452
+ so: {
453
+ exitTitle: "Ka baxdo xaqiijinta?",
454
+ exitMessage: "Ka bixitaanku wuxuu dhammayn doonaa habka xaqiijintaada. Ma hubtaa?",
455
+ continueButton: "Sii wad",
456
+ exitButton: "Ka bax",
457
+ ariaLabelModal: "Xaqiijinta Didit",
458
+ ariaLabelClose: "Xir xaqiijinta"
459
+ },
460
+ sr: {
461
+ exitTitle: "Изаћи из верификације?",
462
+ exitMessage: "Изласком ћете прекинути процес верификације. Да ли сте сигурни?",
463
+ continueButton: "Настави",
464
+ exitButton: "Изађи",
465
+ ariaLabelModal: "Верификација Didit",
466
+ ariaLabelClose: "Затвори верификацију"
467
+ },
468
+ sv: {
469
+ exitTitle: "Lämna verifiering?",
470
+ exitMessage: "Att lämna avslutar din verifieringsprocess. Är du säker?",
471
+ continueButton: "Fortsätt",
472
+ exitButton: "Lämna",
473
+ ariaLabelModal: "Didit-verifiering",
474
+ ariaLabelClose: "Stäng verifiering"
475
+ },
476
+ th: {
477
+ exitTitle: "ออกจากการยืนยันตัวตน?",
478
+ exitMessage: "การออกจะสิ้นสุดกระบวนการยืนยันตัวตนของคุณ คุณแน่ใจหรือไม่?",
479
+ continueButton: "ดำเนินการต่อ",
480
+ exitButton: "ออก",
481
+ ariaLabelModal: "การยืนยันตัวตน Didit",
482
+ ariaLabelClose: "ปิดการยืนยันตัวตน"
483
+ },
484
+ tr: {
485
+ exitTitle: "Doğrulamadan çıkmak istiyor musunuz?",
486
+ exitMessage: "Çıkış, doğrulama sürecinizi sonlandıracak. Emin misiniz?",
487
+ continueButton: "Devam et",
488
+ exitButton: "Çıkış",
489
+ ariaLabelModal: "Didit doğrulama",
490
+ ariaLabelClose: "Doğrulamayı kapat"
491
+ },
492
+ uk: {
493
+ exitTitle: "Вийти з верифікації?",
494
+ exitMessage: "Вихід завершить процес верифікації. Ви впевнені?",
495
+ continueButton: "Продовжити",
496
+ exitButton: "Вийти",
497
+ ariaLabelModal: "Верифікація Didit",
498
+ ariaLabelClose: "Закрити верифікацію"
499
+ },
500
+ uz: {
501
+ exitTitle: "Tekshiruvdan chiqasizmi?",
502
+ exitMessage: "Chiqish tekshiruv jarayonini tugatadi. Ishonchingiz komilmi?",
503
+ continueButton: "Davom etish",
504
+ exitButton: "Chiqish",
505
+ ariaLabelModal: "Didit tekshiruvi",
506
+ ariaLabelClose: "Tekshiruvni yopish"
507
+ },
508
+ vi: {
509
+ exitTitle: "Thoát khỏi xác minh?",
510
+ exitMessage: "Thoát sẽ kết thúc quá trình xác minh của bạn. Bạn có chắc không?",
511
+ continueButton: "Tiếp tục",
512
+ exitButton: "Thoát",
513
+ ariaLabelModal: "Xác minh Didit",
514
+ ariaLabelClose: "Đóng xác minh"
515
+ },
516
+ "zh-CN": {
517
+ exitTitle: "退出验证?",
518
+ exitMessage: "退出将结束您的验证流程。确定要退出吗?",
519
+ continueButton: "继续",
520
+ exitButton: "退出",
521
+ ariaLabelModal: "Didit 验证",
522
+ ariaLabelClose: "关闭验证"
523
+ },
524
+ "zh-TW": {
525
+ exitTitle: "退出驗證?",
526
+ exitMessage: "退出將結束您的驗證流程。確定要退出嗎?",
527
+ continueButton: "繼續",
528
+ exitButton: "退出",
529
+ ariaLabelModal: "Didit 驗證",
530
+ ariaLabelClose: "關閉驗證"
531
+ },
532
+ zh: {
533
+ exitTitle: "退出验证?",
534
+ exitMessage: "退出将结束您的验证流程。确定要退出吗?",
535
+ continueButton: "继续",
536
+ exitButton: "退出",
537
+ ariaLabelModal: "Didit 验证",
538
+ ariaLabelClose: "关闭验证"
539
+ }
540
+ };
541
+ function getTranslations(language) {
542
+ return translationsMap[language] ?? EN;
543
+ }
75
544
 
76
545
  class VerificationModal {
77
546
  constructor(configuration, callbacks) {
@@ -89,6 +558,7 @@ class VerificationModal {
89
558
  this.boundHandleKeydown = null;
90
559
  this.embedded = false;
91
560
  this.embeddedContainer = null;
561
+ this.language = "en";
92
562
  this.modalId = generateModalId();
93
563
  this.config = {
94
564
  zIndex: configuration?.zIndex ?? DEFAULT_CONFIG.zIndex,
@@ -190,20 +660,20 @@ class VerificationModal {
190
660
  }
191
661
 
192
662
  .${CSS_CLASSES.loading} svg {
193
- width: 48px;
194
- height: 48px;
663
+ width: 4rem;
664
+ height: 4rem;
195
665
  animation: didit-spin 1s linear infinite;
196
666
  }
197
667
 
198
668
  .${CSS_CLASSES.loading} circle {
199
669
  stroke: #e5e5e5;
200
- stroke-width: 3;
670
+ stroke-width: 2.5;
201
671
  fill: none;
202
672
  }
203
673
 
204
674
  .${CSS_CLASSES.loading} path {
205
675
  stroke: #525252;
206
- stroke-width: 3;
676
+ stroke-width: 2.5;
207
677
  stroke-linecap: round;
208
678
  fill: none;
209
679
  }
@@ -334,12 +804,13 @@ class VerificationModal {
334
804
  this.createEmbeddedDOM();
335
805
  return;
336
806
  }
807
+ const t = getTranslations(this.language);
337
808
  this.overlay = document.createElement("div");
338
809
  this.overlay.id = this.modalId;
339
810
  this.overlay.className = CSS_CLASSES.overlay;
340
811
  this.overlay.setAttribute("role", "dialog");
341
812
  this.overlay.setAttribute("aria-modal", "true");
342
- this.overlay.setAttribute("aria-label", "Didit Verification");
813
+ this.overlay.setAttribute("aria-label", t.ariaLabelModal);
343
814
  this.container = document.createElement("div");
344
815
  this.container.className = CSS_CLASSES.container;
345
816
  this.loadingEl = document.createElement("div");
@@ -353,7 +824,7 @@ class VerificationModal {
353
824
  if (this.config.showCloseButton) {
354
825
  const closeBtn = document.createElement("button");
355
826
  closeBtn.className = CSS_CLASSES.closeButton;
356
- closeBtn.setAttribute("aria-label", "Close verification");
827
+ closeBtn.setAttribute("aria-label", t.ariaLabelClose);
357
828
  closeBtn.innerHTML = `
358
829
  <svg width="14" height="14" viewBox="0 0 14 14">
359
830
  <line x1="1" y1="1" x2="13" y2="13" />
@@ -366,17 +837,17 @@ class VerificationModal {
366
837
  this.iframe = document.createElement("iframe");
367
838
  this.iframe.className = CSS_CLASSES.iframe;
368
839
  this.iframe.setAttribute("allow", "camera; microphone; fullscreen; autoplay; encrypted-media; geolocation");
369
- this.iframe.setAttribute("title", "Didit Verification");
840
+ this.iframe.setAttribute("title", t.ariaLabelModal);
370
841
  this.iframe.addEventListener("load", () => this.handleIframeLoad());
371
842
  this.confirmOverlay = document.createElement("div");
372
843
  this.confirmOverlay.className = CSS_CLASSES.confirmOverlay;
373
844
  this.confirmOverlay.innerHTML = `
374
845
  <div class="${CSS_CLASSES.confirmBox}">
375
- <h3>Exit verification?</h3>
376
- <p>Exiting will end your verification process. Are you sure?</p>
846
+ <h3>${t.exitTitle}</h3>
847
+ <p>${t.exitMessage}</p>
377
848
  <div class="didit-confirm-actions">
378
- <button type="button" data-action="continue">Continue</button>
379
- <span data-action="exit">Exit</span>
849
+ <button type="button" data-action="continue">${t.continueButton}</button>
850
+ <span data-action="exit">${t.exitButton}</span>
380
851
  </div>
381
852
  </div>
382
853
  `;
@@ -414,7 +885,7 @@ class VerificationModal {
414
885
  this.iframe = document.createElement("iframe");
415
886
  this.iframe.className = CSS_CLASSES.iframe;
416
887
  this.iframe.setAttribute("allow", "camera; microphone; fullscreen; autoplay; encrypted-media; geolocation");
417
- this.iframe.setAttribute("title", "Didit Verification");
888
+ this.iframe.setAttribute("title", getTranslations(this.language).ariaLabelModal);
418
889
  this.iframe.addEventListener("load", () => this.handleIframeLoad());
419
890
  this.container.appendChild(this.loadingEl);
420
891
  this.container.appendChild(this.iframe);
@@ -502,6 +973,7 @@ class VerificationModal {
502
973
  this.callbacks.onCloseConfirmed();
503
974
  }
504
975
  open(verificationUrl) {
976
+ this.language = detectLanguageFromUrl(verificationUrl);
505
977
  if (!this.overlay && !this.container) {
506
978
  this.createDOM();
507
979
  this.setupEventListeners();