ibandit 1.14.0 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a67c31f07d7b33b4f60998d4e4fd97473c72c36f23817bb07e5d1d632fa7aba9
4
- data.tar.gz: 680db335cd4e6697c45f42550145ed5cce83262ab83eb6abb0d929579cfb00fb
3
+ metadata.gz: 15eee0ef8f82ced114c7aedc52a70c88ab69877928356200917723e0416af1a8
4
+ data.tar.gz: a1d8b2feda3f775c0c25f481f58194e5e9dab9af2e8d8406007697e96564d178
5
5
  SHA512:
6
- metadata.gz: 5498e32bae4a3779c2a5965d3b71c375ee823582803bbf2e78a7667476cbd7af6be0b7bbdd101a14bd678bd262653e14f481a52cbe8a65a728a10e0916441557
7
- data.tar.gz: 8d4314276d23c4cc338d9b31d634a48fef8ad4c4c3aface176d99361550a9dbf15a83429ed90fc22aacec48dd5f3ac20dcf12af675535d97d52fe3453ba3f4b5
6
+ metadata.gz: a728382a2bb8e522ca8cb547938052f9fdf84dc1d81388e07f6465705c81ea61ad1b0a1cfd84deac1cc5a9f6d873ca98c9f510d1526f07ffff48fa9e746c08fa
7
+ data.tar.gz: 3a5d6917918b1744b9c4dd86651f6099acea270a4b1029b2f7cbc18b25bdd832271b9780e35c8141bcc8273736859698bb1b0893a3688833d4690e3480486c8e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.15.0 - March 28, 2023
2
+
3
+ - Improve the error messages that are generated
4
+
1
5
  ## 1.14.0 - March 28, 2023
2
6
 
3
7
  - Update IBAN registry #233
@@ -10,3 +10,10 @@ da:
10
10
  invalid_format: "Uventet format for en IBAN fra %{country_code}."
11
11
  is_invalid: "er ugyldig"
12
12
  does_not_support_payments: "understøtter ikke betalinger"
13
+ has_invalid_format: "ugyldigt format"
14
+ failed_checksum_test: "bestod ikke kontrolsumtesten"
15
+ failed_modulus_check: "bestod ikke moduluskontrollen"
16
+ has_invalid_length: "ugyldig længde"
17
+ bank_code_does_not_exist: "bankkoden findes ikke"
18
+ has_invalid_clearing_code_length: "længden på clearingskoden er ugyldig"
19
+ has_invalid_serial_number: "ugyldigt serienummer"
@@ -10,3 +10,10 @@ de:
10
10
  invalid_format: "Unerwartetes Format für eine %{country_code}-IBAN."
11
11
  is_invalid: "ist ungültig"
12
12
  does_not_support_payments: "unterstützt keine Zahlungen"
13
+ has_invalid_format: "Format ist ungültig"
14
+ failed_checksum_test: "Prüfsummentest nicht bestanden"
15
+ failed_modulus_check: "Modulprüfung nicht bestanden"
16
+ has_invalid_length: "Länge ist ungültig"
17
+ bank_code_does_not_exist: "Bankleitzahl existiert nicht"
18
+ has_invalid_clearing_code_length: "Länge des Verrechnungscodes ist ungültig"
19
+ has_invalid_serial_number: "Seriennummer ist ungültig"
@@ -10,3 +10,10 @@ en:
10
10
  invalid_format: "Unexpected format for a %{country_code} IBAN."
11
11
  is_invalid: "is invalid"
12
12
  does_not_support_payments: "does not support payments"
13
+ has_invalid_format: "format is invalid"
14
+ failed_checksum_test: "did not pass checksum test"
15
+ failed_modulus_check: "did not pass modulus check"
16
+ has_invalid_length: "length is invalid"
17
+ bank_code_does_not_exist: "bank code does not exist"
18
+ has_invalid_clearing_code_length: "clearing code length is invalid"
19
+ has_invalid_serial_number: "serial number is invalid"
@@ -10,3 +10,10 @@ es:
10
10
  invalid_format: "Formato inesperado para un IBAN de %{country_code}."
11
11
  is_invalid: "no es válido"
12
12
  does_not_support_payments: "no admite pagos"
13
+ has_invalid_format: "formato invalido"
14
+ failed_checksum_test: "fallo en suma de control"
15
+ failed_modulus_check: "fallo en control de modulo"
16
+ has_invalid_length: "tamaño invalido"
17
+ bank_code_does_not_exist: "codigo bancario inexistente"
18
+ has_invalid_clearing_code_length: "codigo de oficina de oficina de compensación invalido"
19
+ has_invalid_serial_number: "número de serie invalido"
@@ -10,3 +10,10 @@ fr:
10
10
  invalid_format: "Format non attendu pour un IBAN %{country_code}."
11
11
  is_invalid: "n'est pas valide"
12
12
  does_not_support_payments: "ne prend pas en charge les paiements"
13
+ has_invalid_format: "le format n'est pas valide"
14
+ failed_checksum_test: "échec du test de la somme de contrôle"
15
+ failed_modulus_check: "échec du test de module"
16
+ has_invalid_length: "la longueur n'est pas valide"
17
+ bank_code_does_not_exist: "le code de la banque n'existe pas"
18
+ has_invalid_clearing_code_length: "la longueur du clearing code n'est pas valide"
19
+ has_invalid_serial_number: "le numéro de série n'est pas valide"
@@ -9,4 +9,12 @@ it:
9
9
  non_alphanumeric_characters: "Caratteri non alfanumerici trovati: %{characters}"
10
10
  invalid_format: "Formato imprevisto per un IBAN %{country_code}."
11
11
  is_invalid: "non è valido"
12
- does_not_support_payments: "non supporta i pagamenti"
12
+ does_not_support_payments: "non supporta i pagamenti"
13
+ has_invalid_format: "formato non valido"
14
+ failed_checksum_test: "test del checksum non superato"
15
+ failed_modulus_check: "test del modulo non superato"
16
+ has_invalid_length: "lunghezza non valida"
17
+ bank_code_does_not_exist: "codice banca inesistente"
18
+ has_invalid_clearing_code_length: "lunghezza clearing code non valida"
19
+ has_invalid_serial_number: "numero di serie non valido"
20
+
@@ -10,3 +10,10 @@ nb:
10
10
  invalid_format: "Uventet format for IBAN for %{country_code}."
11
11
  is_invalid: "er ikke gyldig"
12
12
  does_not_support_payments: "støtter ikke betalinger"
13
+ has_invalid_format: "formatet er ugyldig"
14
+ failed_checksum_test: "besto ikke kontrollsumtesten"
15
+ failed_modulus_check: "besto ikke tallverdikontrollen"
16
+ has_invalid_length: "ugyldig lengde"
17
+ bank_code_does_not_exist: "bankkoden eksisterer ikke"
18
+ has_invalid_clearing_code_length: "registreringsnummerets lengde er ugyldig"
19
+ has_invalid_serial_number: "ugyldig serienummer"
@@ -10,3 +10,10 @@ nl:
10
10
  invalid_format: "Onverwachte formaat voor een %{country_code} IBAN."
11
11
  is_invalid: "is ongeldig"
12
12
  does_not_support_payments: "ondersteunt geen betalingen"
13
+ has_invalid_format: "indeling is ongeldig"
14
+ failed_checksum_test: "checksumtest is mislukt"
15
+ failed_modulus_check: "moduluscontrole is mislukt"
16
+ has_invalid_length: "lengte is ongeldig"
17
+ bank_code_does_not_exist: "bankcode bestaat niet"
18
+ has_invalid_clearing_code_length: "lengte clearingcode is ongeldig"
19
+ has_invalid_serial_number: "serienummer is ongeldig"
@@ -10,3 +10,10 @@ pt:
10
10
  invalid_format: "Formato inesperado para um IBAN %{country_code}."
11
11
  is_invalid: "é inválido"
12
12
  does_not_support_payments: "não suporta pagamentos"
13
+ has_invalid_format: "o formato é inválido"
14
+ failed_checksum_test: "não passou no teste de verificação de soma"
15
+ failed_modulus_check: "não passou na verificação do módulo"
16
+ has_invalid_length: "o comprimento é inválido"
17
+ bank_code_does_not_exist: "o código do banco não existe"
18
+ has_invalid_clearing_code_length: "o comprimento do código de libertação é inválido"
19
+ has_invalid_serial_number: "o número de série é inválido"
@@ -10,3 +10,10 @@ sl:
10
10
  invalid_format: "Nepričakovana oblika zapisa %{country_code} v IBAN."
11
11
  is_invalid: "ni veljavno"
12
12
  does_not_support_payments: "ne podpira plačil"
13
+ has_invalid_format: "oblika zapisa ni veljavna"
14
+ failed_checksum_test: "neuspešen preizkus kontrolne vsote"
15
+ failed_modulus_check: "neuspešno preverjanje modula"
16
+ has_invalid_length: "dolžina ni veljavna"
17
+ bank_code_does_not_exist: "koda banke ne obstaja"
18
+ has_invalid_clearing_code_length: "dolžina klirinške kode ni veljavna"
19
+ has_invalid_serial_number: "serijska številka ni veljavna"
@@ -10,3 +10,10 @@ sv:
10
10
  invalid_format: "Oväntat format för %{country_code} IBAN."
11
11
  is_invalid: "är ogiltig"
12
12
  does_not_support_payments: "stödjer inte betalningar"
13
+ has_invalid_format: "ogiltigt format"
14
+ failed_checksum_test: "felaktig kontrollsumma"
15
+ failed_modulus_check: "felaktig modulkontroll"
16
+ has_invalid_length: "ogiltig längd"
17
+ bank_code_does_not_exist: "bankkoden existerar inte"
18
+ has_invalid_clearing_code_length: "clearingnumrets längd är ogiltigt"
19
+ has_invalid_serial_number: "ogiltigt serienummer"
@@ -25,5 +25,9 @@ module Ibandit
25
25
  DECONSTRUCTABLE_IBAN_COUNTRY_CODES +
26
26
  PSEUDO_IBAN_COUNTRY_CODES
27
27
  ).uniq
28
+
29
+ SUPPORTED_LOCALES = %w[
30
+ da de en es fr it nb nl pt sl sv
31
+ ].freeze
28
32
  end
29
33
  end
data/lib/ibandit/iban.rb CHANGED
@@ -247,7 +247,7 @@ module Ibandit
247
247
  )
248
248
  true
249
249
  else
250
- @errors[:bank_code] = Ibandit.translate(:is_invalid)
250
+ @errors[:bank_code] = Ibandit.translate(:has_invalid_format)
251
251
  false
252
252
  end
253
253
  end
@@ -261,7 +261,7 @@ module Ibandit
261
261
  )
262
262
  true
263
263
  else
264
- @errors[:branch_code] = Ibandit.translate(:is_invalid)
264
+ @errors[:branch_code] = Ibandit.translate(:has_invalid_format)
265
265
  false
266
266
  end
267
267
  end
@@ -274,7 +274,7 @@ module Ibandit
274
274
  )
275
275
  true
276
276
  else
277
- @errors[:account_number] = Ibandit.translate(:is_invalid)
277
+ @errors[:account_number] = Ibandit.translate(:has_invalid_format)
278
278
  false
279
279
  end
280
280
  end
@@ -332,7 +332,7 @@ module Ibandit
332
332
  def valid_swedish_swift_details?
333
333
  unless Sweden::Validator.bank_code_exists?(swift_bank_code)
334
334
  bank_code_field = bank_code.nil? ? :account_number : :bank_code
335
- @errors[bank_code_field] = Ibandit.translate(:is_invalid)
335
+ @errors[bank_code_field] = Ibandit.translate(:bank_code_does_not_exist)
336
336
  @errors.delete(:bank_code) if bank_code.nil?
337
337
  return false
338
338
  end
@@ -344,7 +344,7 @@ module Ibandit
344
344
  )
345
345
 
346
346
  unless length_valid
347
- @errors[:account_number] = Ibandit.translate(:is_invalid)
347
+ @errors[:account_number] = Ibandit.translate(:has_invalid_length)
348
348
  return false
349
349
  end
350
350
 
@@ -353,7 +353,7 @@ module Ibandit
353
353
 
354
354
  def valid_swedish_local_details?
355
355
  unless Sweden::Validator.valid_clearing_code_length?(branch_code)
356
- @errors[:branch_code] = Ibandit.translate(:is_invalid)
356
+ @errors[:branch_code] = Ibandit.translate(:has_invalid_clearing_code_length)
357
357
  return false
358
358
  end
359
359
 
@@ -363,7 +363,7 @@ module Ibandit
363
363
  )
364
364
 
365
365
  unless valid_serial_number
366
- @errors[:account_number] = Ibandit.translate(:is_invalid)
366
+ @errors[:account_number] = Ibandit.translate(:has_invalid_serial_number)
367
367
  return false
368
368
  end
369
369
 
@@ -410,7 +410,7 @@ module Ibandit
410
410
  (1 * (code_digits[2] + code_digits[5] + code_digits[8]))
411
411
  ) % 10
412
412
 
413
- @errors[:bank_code] = Ibandit.translate(:is_invalid) unless mod.zero?
413
+ @errors[:bank_code] = Ibandit.translate(:failed_checksum_test) unless mod.zero?
414
414
 
415
415
  mod.zero?
416
416
  end
@@ -518,21 +518,21 @@ module Ibandit
518
518
  def valid_modulus_check_bank_code?
519
519
  return true if Ibandit.modulus_checker.valid_bank_code?(self)
520
520
 
521
- @errors[:bank_code] = Ibandit.translate(:is_invalid)
521
+ @errors[:bank_code] = Ibandit.translate(:failed_modulus_check)
522
522
  false
523
523
  end
524
524
 
525
525
  def valid_modulus_check_branch_code?
526
526
  return true if Ibandit.modulus_checker.valid_branch_code?(self)
527
527
 
528
- @errors[:branch_code] = Ibandit.translate(:is_invalid)
528
+ @errors[:branch_code] = Ibandit.translate(:failed_modulus_check)
529
529
  false
530
530
  end
531
531
 
532
532
  def valid_modulus_check_account_number?
533
533
  return true if Ibandit.modulus_checker.valid_account_number?(self)
534
534
 
535
- @errors[:account_number] = Ibandit.translate(:is_invalid)
535
+ @errors[:account_number] = Ibandit.translate(:failed_modulus_check)
536
536
  false
537
537
  end
538
538
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ibandit
4
- VERSION = "1.14.0"
4
+ VERSION = "1.15.0"
5
5
  end
data/lib/ibandit.rb CHANGED
@@ -37,7 +37,7 @@ module Ibandit
37
37
  end
38
38
 
39
39
  def translate(key, options = {})
40
- I18n.translate(key, scope: [:ibandit], **options)
40
+ I18n.translate(key, scope: [:ibandit], **options.merge(raise: true))
41
41
  end
42
42
  end
43
43
  end