Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion lib/locales/en-PAK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,23 @@ en-PAK:
- Punjab
- Sindh
- Islamabad Capital Territory
- Federally Administered Tribal Areas
- Azad Jammu and Kashmir
- Gilgit-Baltistan
state_abbr:
- BA
- KPK
- PB
- SD
- ICT
- AJK
- GB
default_country:
- Pakistan
- Islamic Republic of Pakistan
default_country_code:
- PK
default_time_zone:
- Asia/Karachi
internet:
domain_suffix:
- pk
Expand Down Expand Up @@ -376,3 +385,17 @@ en-PAK:
- "##########"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mentioned that this mixes both landline and mobile (even though that too is wrong per Pakistan format. Should this format be updated as well to differentiate them from the cell phones?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

03######### is the most widely used format

- "### #######"
- 03##-#######
cell_phone:
formats:
- "0311#######"
- "0312#######"
- "0313#######"
- "0314#######"
- "0315#######"
- "0300#######"
- "0301#######"
- "0321#######"
- "0322#######"
- "0345#######"
- "0346#######"
- "0346#######"
8 changes: 8 additions & 0 deletions test/test_en_pak_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def teardown

def test_en_pak_methods
assert_kind_of String, Faker::Address.state
assert_kind_of String, Faker::Address.state_abbr
assert_kind_of String, Faker::Address.default_country
assert_kind_of String, Faker::Address.default_time_zone
assert_kind_of String, Faker::Address.postcode
assert_match(/\A(Pakistan|Islamic Republic of Pakistan)\z/, Faker::Address.default_country)
end
Expand All @@ -33,4 +35,10 @@ def test_en_pak_name_methods
assert_kind_of String, Faker::Name.last_name
assert_kind_of String, Faker::Name.name_with_middle
end

def test_en_pak_cell_phone_is_valid
mobile = Faker::PhoneNumber.cell_phone

assert_match(/03\d{2}\d{7}/, mobile)
end
end