-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Kenya to supported countries #2871
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9ebe0c2
Add Kenya to supported countries
AndrewNduati 0d1da0e
Merge branch 'main' into feat/add-kenya
AndrewNduati 5ef42c9
Add tests for locale
AndrewNduati ae207d3
clan up pull request
AndrewNduati 137e1e3
Merge branch 'faker-ruby:main' into feat/add-kenya
AndrewNduati 9d7bea9
Add landline telephone numbers and cell phone formats
AndrewNduati 03a1a2f
Merge remote-tracking branch 'origin/feat/add-kenya' into feat/add-kenya
AndrewNduati 99d399e
Merge branch 'main' into feat/add-kenya
AndrewNduati File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,212 @@ | ||
en-KE: | ||
faker: | ||
internet: | ||
domain_suffix: | ||
- ke | ||
- co.ke | ||
- org.ke | ||
- or.ke | ||
- go.ke | ||
- ac.ke | ||
- info.ke | ||
address: | ||
default_country: | ||
- Republic of Kenya | ||
default_country_code: | ||
- KE | ||
counties: | ||
- Kiambu | ||
- Siaya | ||
- Bungoma | ||
- Kericho | ||
- Kilifi | ||
- Kisumu | ||
- Machakos | ||
- Nakuru | ||
- Kisii | ||
- Busia | ||
- Homa Bay | ||
- Kajiado | ||
- Kakamega | ||
- Laikipia | ||
- Migori | ||
- Taita-Taveta | ||
- Embu | ||
- Kitui | ||
- Meru | ||
- Murang'a | ||
- Nyamira | ||
- Turkana | ||
- Trans-Nzoia | ||
- Uasin Gishu | ||
- Vihiga | ||
- Baringo | ||
- Bomet | ||
- Elgeyo-Marakwet | ||
- Garissa | ||
- Isiolo | ||
- Kirinyaga | ||
- Kwale | ||
- Mandera | ||
- Marsabit | ||
- Mombasa | ||
- Nairobi | ||
- Nandi | ||
- Narok | ||
- Nyandarua | ||
- Nyeri | ||
- Samburu | ||
- Tharaka-Nithi | ||
- Wajir | ||
- West Pokot | ||
county: | ||
- "#{counties}" | ||
cities: | ||
- Bungoma | ||
- Busia | ||
- El Wak | ||
- Eldoret | ||
- Emali | ||
- Embu | ||
- Gilgil | ||
- Homa Bay | ||
- Isiolo | ||
- Juja | ||
- Kakamega | ||
- Karuri | ||
- Kenol | ||
- Kericho | ||
- Kiambu | ||
- Kikuyu | ||
- Kilifi | ||
- Kimilili | ||
- Kiserian | ||
- Kisii | ||
- Kisumu | ||
- Kitengela | ||
- Limuru | ||
- Lodwar | ||
- Machakos | ||
- Malindi | ||
- Mandera | ||
- Mavoko | ||
- Meru | ||
- Migori | ||
- Mombasa | ||
- Moyale | ||
- Mtwapa | ||
- Muranga | ||
- Nairobi | ||
- Naivasha | ||
- Nakuru | ||
- Nanyuki | ||
- Narok | ||
- Ngong | ||
- Nyeri | ||
- Ruiru | ||
- Thika | ||
- Ukunda | ||
- Voi | ||
- Wajir | ||
- Wanguru | ||
- Webuye | ||
city: | ||
- "#{cities}" | ||
company: | ||
company_names: | ||
- ABSA Kenya | ||
- ARM Cement | ||
- Africa Development Bank (AfDB) | ||
- B.O.C Kenya | ||
- Bamburi Cement | ||
- Britam Holdings | ||
- British American Tobacco Kenya | ||
- CIC Insurance Group | ||
- Car & General (K) | ||
- Carbacid Investments | ||
- Centum Investment | ||
- Crown Paints Kenya | ||
- Deacons (East Africa) | ||
- Diamond Trust Bank Kenya | ||
- E.A Cables | ||
- E.A Portland Cement | ||
- Eaagads | ||
- East African Breweries | ||
- Equity Group Holdings | ||
- Eveready East Africa | ||
- Express Kenya | ||
- Flame Tree Group Holdings | ||
- HF Group | ||
- Home Afrika | ||
- Homeboyz Entertainment | ||
- I & M Holdings | ||
- ILAM Fahari I-REIT | ||
- Jubilee Holdings | ||
- KCB Group | ||
- Kakuzi | ||
- Kapchorua Tea Kenya | ||
- KenGen | ||
- Kenya Airways | ||
- Kenya Orchards | ||
- Kenya Power & Lighting | ||
- Kenya Re-Insurance Corporation | ||
- Kurwitu Ventures | ||
- Liberty Kenya Holdings | ||
- Limuru Tea | ||
- Longhorn Publishers | ||
- Mumias Sugar | ||
- NCBA Group | ||
- Nairobi Business Ventures | ||
- Nairobi Securities Exchange | ||
- Nation Media Group | ||
- Olympia Capital Holdings | ||
- Safaricom | ||
- Sameer Africa | ||
- Sanlam Kenya | ||
- Sasini | ||
- Stanbic Holdings | ||
- Standard Chartered Bank Kenya | ||
- Standard Group | ||
- TPS Eastern Africa (Serena) | ||
- The Co-operative Bank of Kenya | ||
- Total Kenya | ||
- Trans-Century | ||
- Uchumi Supermarket | ||
- Umeme | ||
- Unga Group | ||
- WPP Scangroup | ||
- Williamson Tea Kenya | ||
suffix: | ||
- Co. | ||
- Ltd | ||
- Plc | ||
- Trust | ||
name: | ||
- "#{company_names}" | ||
phone_number: | ||
country_code: | ||
- "254" | ||
area_code: | ||
# area codes for Nairobi, Mombasa, Eldoret & Kisumu cities | ||
- "20" | ||
- "41" | ||
- "51" | ||
- "57" | ||
formats: | ||
- "### #######" | ||
- "##########" | ||
- "###-#######" | ||
cell_phone: | ||
formats: | ||
# safaricom | ||
- "0711 ######" | ||
- "0722 ######" | ||
# Airtel | ||
- "010# ######" | ||
- "0730 ######" | ||
# Telkom | ||
- "0770 ######" | ||
- "0771 ######" | ||
# Equitel | ||
- "0763 ######" | ||
- "0764 ######" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'test_helper' | ||
|
||
class TestEnKeLocale < Test::Unit::TestCase | ||
def setup | ||
Faker::Config.locale = 'en-KE' | ||
end | ||
|
||
def teardown | ||
Faker::Config.locale = nil | ||
end | ||
|
||
def test_en_ke_address_methods | ||
assert Faker::Address.city.is_a? String | ||
assert Faker::Address.county.is_a? String | ||
assert Faker::Address.default_country.is_a? String | ||
assert Faker::Address.default_country_code.is_a? String | ||
end | ||
|
||
def test_en_ke_company_methods | ||
assert Faker::Company.name.is_a? String | ||
assert Faker::Company.suffix.is_a? String | ||
assert Faker::Company.company_names.is_a? String | ||
end | ||
|
||
def test_en_ke_internet_methods | ||
assert Faker::Internet.domain_suffix.is_a? String | ||
end | ||
|
||
def test_en_ke_country_code_starts_with_254 | ||
phone_number = Faker::PhoneNumber.country_code | ||
|
||
assert_equal '+254', phone_number[0..3] | ||
end | ||
|
||
def test_en_ke_cell_phone_starts_with_0 | ||
cell_number = Faker::PhoneNumber.cell_phone | ||
|
||
assert_equal '0', cell_number[0] | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we might want to break it down by country_code, area code, etc. Here's an example: https://github.com/faker-ruby/faker/blob/main/lib/locales/en/phone_number.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefannibrasil Made the changes and updated the tests too. Please let me know if there's anything else needed from me :)