faker-ruby / faker

A library for generating fake data such as names, addresses, and phone numbers.
MIT License
11.28k stars 3.18k forks source link

Add Cell Phone, Default Time Zone and State Abbreviation translation for en-PAK locale #3024

Open wonderer007 opened 3 days ago

wonderer007 commented 3 days ago

Motivation / Background

en-PAK locale missing cell phone format. The existing Faker::PhoneNumber.phone_number generator mixes both landline and mobile (even though that too is wrong per Pakistan format). This PR adds cell phone format for the en-PAK locale.

It also includes state abbreviations and default time zones.

Additional information

  1. https://en.wikipedia.org/wiki/Abbreviations_of_administrative_units_of_Pakistan
  2. https://en.wikipedia.org/wiki/List_of_telecommunication_companies_in_Pakistan

Checklist

Before submitting the PR make sure the following are checked:

If you're proposing a new generator or locale:

wonderer007 commented 3 days ago

Here is the output that I have now in the console:

3.2.2 :021 > Faker::Config.locale = 'en-PAK'
 => "en-PAK" 
3.2.2 :022 > Faker::PhoneNumber.cell_phone
 => "0321-5631055" 
3.2.2 :023 > Faker::PhoneNumber.cell_phone
 => "0346-6844205" 
3.2.2 :024 > Faker::PhoneNumber.cell_phone
 => "0301-8081558" 
3.2.2 :025 > Faker::Address.default_time_zone
 => "Asia/Karachi" 
3.2.2 :026 > Faker::Address.state_abbr
 => "PK-JK" 
3.2.2 :027 > Faker::Address.state_abbr
 => "PK-SD" 
3.2.2 :028 > Faker::Address.state_abbr
 => "PK-TA"