Skip to content
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 8 commits into from Feb 5, 2024

Conversation

AndrewNduati
Copy link
Contributor

@AndrewNduati AndrewNduati commented Dec 18, 2023

Motivation / Background

This Pull Request has been created because the country Kenya is missing from the list of countries in Faker.

Additional information

I mainly used information from Wikipedia about Kenya and a list of publicly traded companies from the Nairobi Securities Exchange as of November 2023.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug, refactor something, or add a feature.
  • Tests and Rubocop are passing before submitting your proposed changes.
  • You've reviewed and followed the Documentation guidelines.

@AndrewNduati
Copy link
Contributor Author

Updated my branch with changes from main.

Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

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

Hi @AndrewNduati thank you! Could you write tests? thanks!

Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

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

Looking good. Added a few comments ⭐

lib/locales/en-KE.yml Outdated Show resolved Hide resolved
lib/locales/en-KE.yml Outdated Show resolved Hide resolved
lib/locales/en-KE.yml Outdated Show resolved Hide resolved
lib/locales/en-KE.yml Outdated Show resolved Hide resolved
- Trust
name:
- "#{company_names}"
phone_number:
Copy link
Contributor

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

Copy link
Contributor Author

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 :)

@AndrewNduati
Copy link
Contributor Author

Hey @stefannibrasil ,

I've made the recommended updates. Please let me know whether they're in line with the comments you made above. :)

@stefannibrasil
Copy link
Contributor

@AndrewNduati thank you for your patience! Left one comment about the phone numbers.

Also, when I try to use this generator in the console (rake console), I get this error:

Faker::Config.locale = 'en-KE'
=> "en-KE"
irb(main):002> Faker::Address.country
/Users/stefannibrasil/.asdf/installs/ruby/3.0.6/lib/ruby/gems/3.0.0/gems/i18n-1.14.1/lib/i18n.rb:351:in `enforce_available_locales!': "en-KE" is not a valid locale (I18n::InvalidLocale)

Is the generator working for you?

@AndrewNduati
Copy link
Contributor Author

Thanks @stefannibrasil for reviewing this.

I suspect the reason you're running into that error is because en-KE isn't in the gem yet. I replicated this by using the current version of the gem and run into the same error.

To get the current en-KE to work, I launched the console using irb -Ilib command in my current working directory of the gem. So far it looks like it's working, but I've also seen a couple of odd bugs that'll try and fix with the next commit.

irb(main):001> require 'faker'
=> true
 irb(main):003> Faker::Config.locale = 'en-KE'
=> "en-KE"
irb(main):004> Faker::Address.default_country_code
=> "KE"

Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution and for addressing the comments 🇰🇪

@stefannibrasil stefannibrasil merged commit b0ab11d into faker-ruby:main Feb 5, 2024
8 checks passed
keshavbiswa pushed a commit to keshavbiswa/faker that referenced this pull request Mar 17, 2024
* Add Kenya to supported countries

* Add tests for locale

* clan up pull request

* Add landline telephone numbers and cell phone formats
stefannibrasil added a commit that referenced this pull request Mar 19, 2024
* update Faker::Australia to Faker::Locations::Australia

* Bump minitest from 5.21.1 to 5.21.2 (#2894)

Bumps [minitest](https://github.com/minitest/minitest) from 5.21.1 to 5.21.2.
- [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc)
- [Commits](minitest/minitest@v5.21.1...v5.21.2)

---
updated-dependencies:
- dependency-name: minitest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rubocop from 1.59.0 to 1.60.2 (#2896)

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.59.0 to 1.60.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.59.0...v1.60.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add Kenya to supported countries (#2871)

* Add Kenya to supported countries

* Add tests for locale

* clan up pull request

* Add landline telephone numbers and cell phone formats

* Bump minitest from 5.21.2 to 5.22.2 (#2902)

Bumps [minitest](https://github.com/minitest/minitest) from 5.21.2 to 5.22.2.
- [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc)
- [Commits](minitest/minitest@v5.21.2...v5.22.2)

---
updated-dependencies:
- dependency-name: minitest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump test-unit from 3.6.1 to 3.6.2 (#2906)

Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.6.1 to 3.6.2.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](test-unit/test-unit@3.6.1...3.6.2)

---
updated-dependencies:
- dependency-name: test-unit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Refactor `Faker::IDNumber` to `Faker::IdNumber` to be more consistent with other generator's naming convention. (#2858)

* Deprecate IDNumber to IdNumber per issue#2787

* wip

* Add a Faker::Deprecator module

Co-authored-by: Thiago Araujo <thd.araujo@gmail.com>

* Add more specs and improve warning message

---------

Co-authored-by: jamal.mohamed <jamal.mohamed@covermymeds.com>
Co-authored-by: Stefanni Brasil <stefannibrasil@gmail.com>
Co-authored-by: Thiago Araujo <thd.araujo@gmail.com>

* Fix/Deprecate FmaBrotherhood Generator (#2856)

* Favor 'The Room' instead of 'Room'

This commit will rename instances of room to the_room including the
locales.  Originally the `room.md` had a typo that referenced ::Room and
not ::TheRoom which is also fixed here.

Ref:
  - #2787

Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>

* Fix/Deprecate FmaBrotherhood Generator

This commit fixes the naming discrpencies with the FmaBrotherhood (now
FullmetalAlchemistBrotherhood) class and its filename.  This adds
deprecation warnings for the old FmaBrotherhood class and also makes the
new FullmetalAlchemistBrotherhood class.

Fix:
  - #2853

* Refactor deprecation for `FmaBrotherhood`

This commit will refactor the changes from `FmaBrotherhood` to
`FullmetalAlchemistBrotherhood` and use `Faker::Deprecator`.

---------

Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>
Co-authored-by: Stefanni Brasil <stefannibrasil@gmail.com>

* Bump i18n from 1.14.1 to 1.14.4 (#2913)

Bumps [i18n](https://github.com/ruby-i18n/i18n) from 1.14.1 to 1.14.4.
- [Release notes](https://github.com/ruby-i18n/i18n/releases)
- [Changelog](https://github.com/ruby-i18n/i18n/blob/master/CHANGELOG.md)
- [Commits](ruby-i18n/i18n@v1.14.1...v1.14.4)

---
updated-dependencies:
- dependency-name: i18n
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Remove duplicates in doc file (#2914)

* Bump rubocop from 1.60.2 to 1.62.1 (#2916)

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.60.2 to 1.62.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.60.2...v1.62.1)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump yard from 0.9.34 to 0.9.36 (#2909)

Bumps [yard](https://github.com/lsegal/yard) from 0.9.34 to 0.9.36.
- [Release notes](https://github.com/lsegal/yard/releases)
- [Changelog](https://github.com/lsegal/yard/blob/main/CHANGELOG.md)
- [Commits](lsegal/yard@v0.9.34...v0.9.36)

---
updated-dependencies:
- dependency-name: yard
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Deprecated Faker::Australia

* Added Docs for Australia

* Updated Readme to include Locations

* Updated locales path for australia

* updated test to differentiate deprecated methods

* Removed whitespaces from australia.yml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Nduati <nduatiandrew@gmail.com>
Co-authored-by: Jamal-A-Mohamed <37128483+Jamal-A-Mohamed@users.noreply.github.com>
Co-authored-by: jamal.mohamed <jamal.mohamed@covermymeds.com>
Co-authored-by: Stefanni Brasil <stefannibrasil@gmail.com>
Co-authored-by: Thiago Araujo <thd.araujo@gmail.com>
Co-authored-by: Kirk Wang <kirk.wang@scientist.com>
Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>
Co-authored-by: Michael Marusyk <31774981+mmarusyk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants