Skip to content

feat(locale): add country code for en_CA & fr_CA #3476

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

Merged

Conversation

alixlahuec
Copy link
Contributor

Description

Configure country_code for the en_CA and fr_CA locales.

Checklist

✅ I've ran pnpm run preflight
✅ I've read https://github.com/faker-js/faker/blob/next/CONTRIBUTING.md

Copy link

netlify bot commented Apr 14, 2025

Deploy Preview for fakerjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit effc91a
🔍 Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/67fd9462305efc0008ef6459
😎 Deploy Preview https://deploy-preview-3476.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@alixlahuec alixlahuec marked this pull request as ready for review April 14, 2025 23:16
@alixlahuec alixlahuec requested a review from a team as a code owner April 14, 2025 23:16
@Shinigami92 Shinigami92 added c: locale Permutes locale definitions m: location Something is referring to the location module labels Apr 15, 2025
@Shinigami92 Shinigami92 added this to the vAnytime milestone Apr 15, 2025
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.97%. Comparing base (81c9fba) to head (effc91a).
Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #3476      +/-   ##
==========================================
- Coverage   99.97%   99.97%   -0.01%     
==========================================
  Files        2836     2838       +2     
  Lines      218600   218606       +6     
  Branches      952      949       -3     
==========================================
+ Hits       218547   218551       +4     
- Misses         53       55       +2     
Files with missing lines Coverage Δ
src/locales/en_CA/location/country_code.ts 100.00% <100.00%> (ø)
src/locales/en_CA/location/index.ts 100.00% <100.00%> (ø)
src/locales/fr_CA/location/country_code.ts 100.00% <100.00%> (ø)
src/locales/fr_CA/location/index.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xDivisionByZerox xDivisionByZerox merged commit 242cc79 into faker-js:next Apr 16, 2025
25 checks passed
@xDivisionByZerox
Copy link
Member

Thank you for your contribution @alixlahuec 🙏❤️.
I see that this was your first contribution to our project.
Would you mind answering some questions regarding your contribution? This way we can understand the potential struggles or confusions new contributors might have when getting into the project. If you don't want to answer, please ignore this comment:

  1. What did motivate you to do your contribution?
  2. Did you read our documentation regarding contributing before starting to work on your contribution?
  3. How clear was the process of working on your contribution (before the PR) for you? Was there ever a time while working in the project where you didn't know what to do? If so how did you solve your problem?
  4. How clear was the process of the code review (PR) for you? Was there ever a time you felt unsure about the current situation?
  5. Anything else you'd like to share with the Faker team?

@alixlahuec
Copy link
Contributor Author

@xDivisionByZerox Sure, I'd be happy to!

  1. What did motivate you to do your contribution?

My team uses Faker to easily generate test data, we're Canada-based and recently came across some use cases where the locale we used with Faker mattered (we'd been using just en). We recently shipped some work related to addresses and postal codes, and realized our test data was failing validation because en uses US postal codes format by default & we just had never really realized this. I switched us to use en_CA which just makes so much more sense for us, and I noticed it was really easy to make the locale data more complete there so I did a quick PR!

  1. Did you read our documentation regarding contributing before starting to work on your contribution?

Yes ✅

  1. How clear was the process of working on your contribution (before the PR) for you? Was there ever a time while working in the project where you didn't know what to do? If so how did you solve your problem?

It was pretty clear overall, I think there's a few points where I wasn't sure and checked previous contributions / ran commands to be confident I'd done what was needed:

  • I wasn't sure if I needed to write tests.
  • I wasn't sure if I needed to do some kind of validation. I did end up doing it by opening up the Faker docs for the PR, and using the console to create a Faker instance with the locales I was updating, then generated the data kind I updated (country code) to make sure it was giving the expected result.
  • I wasn't sure which locale updates require running the generate command or not, so in doubt I ran it & I got no diffs - I looked at previous PRs that were similar to mine and the diffs were similar, so it looked correct to me
  1. How clear was the process of the code review (PR) for you? Was there ever a time you felt unsure about the current situation?

Super clear (super fast!) 💯 I wasn't too sure how the Faker team organizes releases (what goes into what) but I wasn't worried about it!

  1. Anything else you'd like to share with the Faker team?

Thanks for your work! We love using Faker, and I'll be happy to contribute back to the project when I can

@xDivisionByZerox
Copy link
Member

Thank you for your feedback. It's awesome to see that you were using the documentation preview to validate your changes - very creative.

I wasn't too sure how the Faker team organizes releases [...]

I guess that you might be interested when you will actually be able to use your changes. The faker team tries to do monthly minor releases at the start of a month. So you should able to make your of your changes in Faker v9.8.0 in about 3 weeks. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: locale Permutes locale definitions m: location Something is referring to the location module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants