Skip to content

Commit

Permalink
add country code to some countries
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielbaldao committed Jul 22, 2020
1 parent a373f1d commit 502155f
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 6 deletions.
2 changes: 2 additions & 0 deletions lib/locales/de-AT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ de-AT:
- "#{first_name} #{last_name} #{last_name}"
- "#{first_name} #{last_name} #{last_name}"

country_code: ['43']

phone_number:
formats: ['01 #######', '01#######', '1-#######', '1#######', '0#### ####', '0#########', '####-####', '########']

Expand Down
2 changes: 2 additions & 0 deletions lib/locales/de-CH.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1708,5 +1708,7 @@ de-CH:
internet:
domain_suffix: [com, net, biz, ch, de, li, at, ch, ch]

country_code: ['49']

phone_number:
formats: ['0800 ### ###', '0800 ## ## ##', '0## ### ## ##', '0## ### ## ##', '## ### ## ##', '0900 ### ###', '076 ### ## ##', '78 ### ## ##', '0041 79 ### ## ##']
2 changes: 2 additions & 0 deletions lib/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ de:
material: [Stahl, Holz, Beton, Plastik, Baumwoll, Granit, Gummi, Leder, Seiden, Wolle, Leinen, Marmor, Eisen, Bronze, Kupfer, Aluminium, Papier]
product: [Stuhl, Auto, Computer, Handschuh, Hose, Hemd, Tisch, Schuh, Hut, Teller, Messer, Flasche, Mantel, Lampe, Tastatur, Tasche, Bank, Uhr, Armbanduhr, Geldbörse]

country_code: ['49']

phone_number:
formats: ['(0###) #########', '(0####) #######', '###-#######', '####-########']

Expand Down
3 changes: 3 additions & 0 deletions lib/locales/en-NEP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@ en-NEP:
domain_suffix: ['np', 'com', 'info', 'net', 'org']
company:
suffix: ['Pvt Ltd', 'Group', 'Ltd', 'Limited']

country_code: ['977']

phone_number:
formats: ['##-#######', '#-#######', '########']
2 changes: 2 additions & 0 deletions lib/locales/en-NZ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ en-NZ:
- "#{street_address}, #{community}, #{city} #{postcode}"
- "#{mail_box} #{community} #{postcode}"
- "#{mail_box}, #{community}, #{city} #{postcode}"

country_code: ['64']
phone_number:
formats: ['0# ### ####', '# ### ####']
cell_phone:
Expand Down
1 change: 1 addition & 0 deletions lib/locales/en-PAK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ en-PAK:
domain_suffix: [pk, com, com.pk, name, net, org, html, edu]
company:
suffix: [Pvt Ltd, Limited, Ltd, and Sons, Corp, Group, Brothers, CO]
country_code: ['92']
phone_number:
formats: ['##########', '### #######', '03##-#######']
1 change: 1 addition & 0 deletions lib/locales/en-SG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ en-SG:
street_address:
- "#{building_number} #{street_name}"
default_country: [Singapore]
country_code: ['65']
phone_number:
formats: ['6### ####', '9### ####', '8### ####']
vehicle:
Expand Down
1 change: 1 addition & 0 deletions lib/locales/en-au-ocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ en-au-ocker:
building_number: ['####', '###', '##']
street_suffix: [Avenue, Boulevard, Circle, Circuit, Court, Crescent, Crest, Drive, Estate Dr, Grove, Hill, Island, Junction, Knoll, Lane, Loop, Mall, Manor, Meadow, Mews, Parade, Parkway, Pass, Place, Plaza, Ridge, Road, Run, Square, Station St, Street, Summit, Terrace, Track, Trail, View Rd, Way]
default_country: [Australia]
country_code: ['61']
phone_number:
formats: ['0# #### ####', '# #### ####', '4## ### ###'] #iOS AUS phone formats
cell_phone:
Expand Down
3 changes: 3 additions & 0 deletions lib/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ fr:
- "#{first_name} #{last_name} #{last_name}"
- "#{first_name} #{last_name} #{last_name}"
- "#{first_name} #{last_name} #{last_name}"

country_code: ['33']

phone_number:
formats: ['01########', '02########', '03########', '04########', '05########', '09########', '1########', '2########', '3########', '4########', '5########', '9########', '01 ## ## ## ##', '02 ## ## ## ##', '03 ## ## ## ##', '04 ## ## ## ##', '05 ## ## ## ##', '09 ## ## ## ##', '1 ## ## ## ##', '2 ## ## ## ##', '3 ## ## ## ##', '4 ## ## ## ##', '5 ## ## ## ##', '9 ## ## ## ##']

Expand Down
1 change: 1 addition & 0 deletions lib/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ it:
- "#{first_name} #{last_name} #{last_name}"
- "#{first_name} #{last_name} #{last_name}"
- "#{first_name} #{last_name} #{last_name}"
country_code: ['39']
phone_number:
formats: ['### ## ## ####', '## #######', '## ########', '### #######', '### ########', '#### #######', '#### ########', '0## ### ####', '0## ### ###', '3## ### ###', '3## ### ###']
subscription:
Expand Down
2 changes: 2 additions & 0 deletions lib/locales/nb-NO.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ nb-NO:
- "#{first_name} #{last_name} #{last_name}"
- "#{first_name} #{last_name} #{last_name}"

country_code: ['47']

phone_number:
formats: ["########", "## ## ## ##", "### ## ###", "## ## ## ##"]

Expand Down
2 changes: 2 additions & 0 deletions lib/locales/pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@ pt:
- "#{first_name} #{last_name} #{last_name}"
- "#{first_name} #{last_name} #{last_name}"

country_code: ['351']

phone_number:
formats: ["(##) ###-####", "(##) ###-####", "884 ###-###"]
2 changes: 2 additions & 0 deletions lib/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ ru:
name_with_middle:
- "#{first_name} #{last_name} #{last_name}"

country_code: ['7']

phone_number:
formats: ['(9##)###-##-##']

Expand Down
4 changes: 3 additions & 1 deletion lib/locales/sk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ sk:
first_name:
- "#{male_first_name}"
- "#{female_first_name}"


country_code: ['421']

phone_number:
formats: ['09## ### ###', '0## #### ####', '0# #### ####', '### ### ###']
2 changes: 1 addition & 1 deletion test/test_de_at_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ def test_de_at_name_methods
end

def test_de_at_phone_number_methods
assert_match(/(43)|(06)|(436)[\d\s]+$/, Faker::PhoneNumber.cell_phone)
assert_match(/(43)|(06)|(436)[\d\s]+$/, Faker::PhoneNumber.cell_phone_with_country_code)
end
end
6 changes: 3 additions & 3 deletions test/test_de_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def test_de_space_methods
end

def test_de_cell_phone_countrycode
mobile = Faker::PhoneNumber.cell_phone.gsub(/\D/, '')
assert_equal '4', mobile[0]
assert_equal '9', mobile[1]
mobile = Faker::PhoneNumber.cell_phone_with_country_code.gsub(/\D/, '')

assert_match(/^(0|49)/, mobile)
end
end
2 changes: 1 addition & 1 deletion test/test_fr_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_fr_phone_format

def test_fr_cell_phone_format
mobile = Faker::PhoneNumber.cell_phone.gsub(/\D/, '')
assert_match(/^(0|33)(6|7)\d{8}$/, mobile)
assert_match(/^(6|7)\d{8}$/, mobile)
end

def test_fr_pokemon_methods
Expand Down

0 comments on commit 502155f

Please sign in to comment.