Skip to content

Commit

Permalink
Add spanish license plates (faker-ruby#2103)
Browse files Browse the repository at this point in the history
  • Loading branch information
javierav authored and droznyk committed Oct 23, 2020
1 parent 47dda5d commit 16b8f22
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
56 changes: 56 additions & 0 deletions lib/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,59 @@ es:
payment_methods: ["Tarjeta de credito", "Tarjeta de débito", "Paypal", "Efectivo", "Transferencia de dinero", "Bitcoins", "Cheque", "Apple Pay", "Google Pay", "WeChat Pay", "Alipay", "Visa Checkout"]
subscription_terms: ["Diaria", "Semanal", "Mensual", "Anual", "Bienal", "Trienal", "Quinquenal", "De por vida"]
payment_terms: ["Pago por adelantado", "Mensual", "Anual", "Suscripción completa"]

vehicle:
license_plate: '####[B-DF-HJ-NPR-TV-Z]{3}'
license_plate_by_state:
A: 'A####[A-PS-Z]{1,2}'
AB: 'AB####[A-PS-Z]{1,2}'
AL: 'AL####[A-PS-Z]{1,2}'
AV: 'AV####[A-PS-Z]{1,2}'
B: 'B####[A-PS-Z]{1,2}'
BA: 'BA####[A-PS-Z]{1,2}'
BI: 'BI####[A-PS-Z]{1,2}'
BU: 'BU####[A-PS-Z]{1,2}'
C: 'C####[A-PS-Z]{1,2}'
CA: 'CA####[A-PS-Z]{1,2}'
CC: 'CC####[A-PS-Z]{1,2}'
CS: 'CS####[A-PS-Z]{1,2}'
CE: 'CE####[A-PS-Z]{1,2}'
CO: 'CO####[A-PS-Z]{1,2}'
CR: 'CR####[A-PS-Z]{1,2}'
CU: 'CU####[A-PS-Z]{1,2}'
GC: 'GC####[A-PS-Z]{1,2}'
GI: 'GI####[A-PS-Z]{1,2}'
GR: 'GR####[A-PS-Z]{1,2}'
GU: 'GU####[A-PS-Z]{1,2}'
H: 'H####[A-PS-Z]{1,2}'
HU: 'HU####[A-PS-Z]{1,2}'
IB: 'IB####[A-PS-Z]{1,2}'
J: 'J####[A-PS-Z]{1,2}'
L: 'L####[A-PS-Z]{1,2}'
LE: 'LE####[A-PS-Z]{1,2}'
LO: 'LO####[A-PS-Z]{1,2}'
LU: 'LU####[A-PS-Z]{1,2}'
M: 'M####[A-PS-Z]{1,2}'
MA: 'MA####[A-PS-Z]{1,2}'
ML: 'ML####[A-PS-Z]{1,2}'
MU: 'MU####[A-PS-Z]{1,2}'
NA: 'NA####[A-PS-Z]{1,2}'
O: 'O####[A-PS-Z]{1,2}'
OU: 'OU####[A-PS-Z]{1,2}'
P: 'P####[A-PS-Z]{1,2}'
PO: 'PO####[A-PS-Z]{1,2}'
S: 'S####[A-PS-Z]{1,2}'
SA: 'SA####[A-PS-Z]{1,2}'
SE: 'SE####[A-PS-Z]{1,2}'
SG: 'SG####[A-PS-Z]{1,2}'
SO: 'SO####[A-PS-Z]{1,2}'
SS: 'SS####[A-PS-Z]{1,2}'
T: 'T####[A-PS-Z]{1,2}'
TE: 'TE####[A-PS-Z]{1,2}'
TF: 'TF####[A-PS-Z]{1,2}'
TO: 'TO####[A-PS-Z]{1,2}'
V: 'V####[A-PS-Z]{1,2}'
VA: 'VA####[A-PS-Z]{1,2}'
VI: 'VI####[A-PS-Z]{1,2}'
Z: 'Z####[A-PS-Z]{1,2}'
ZA: 'ZA####[A-PS-Z]{1,2}'
2 changes: 2 additions & 0 deletions test/test_es_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def test_es_name_methods

def test_es_vehicle_methods
assert Faker::Vehicle.license_plate.is_a? String
assert Faker::Vehicle.license_plate.match(/\d{4}[A-Z]{3}/)
assert Faker::Vehicle.license_plate(state_abbreviation: 'GR').match(/GR\d{4}[A-Z]{1,2}/)
end

def test_es_subscription_methods
Expand Down

0 comments on commit 16b8f22

Please sign in to comment.