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

Address doesn't use street_name / street_root from locale #491

Closed
palimondo opened this issue Feb 14, 2022 · 1 comment · Fixed by #966
Closed

Address doesn't use street_name / street_root from locale #491

palimondo opened this issue Feb 14, 2022 · 1 comment · Fixed by #966
Labels
c: bug Something isn't working has workaround Workaround provided or linked p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug

Comments

@palimondo
Copy link

palimondo commented Feb 14, 2022

Describe the bug

When testing with faker.locale = "de", I have noticed that the Address.streetName generates the street name from English first names and does not use the localized streets provided in street_name / street_root / street files.

This seems like a bug, but I'm completely new to faker-js, so I'm not sure if this is just a preparation for some future refactoring or a regression.

Reproduction

faker.locale = 'de';
console.log(faker.address.streetName())
// expected to return something from:
// https://github.com/faker-js/faker/blob/main/src/locales/de/address/street_root.ts

Additional Info

I would have expected the implementation to look like:

  streetName(): string {
    return this.faker.random.arrayElement(
      this.faker.definitions.address.street_name
    );
  }
@palimondo palimondo added the s: pending triage Pending Triage label Feb 14, 2022
@Shinigami92
Copy link
Member

I investigated a bit the code and yes, looks weird 🤔
We are currently rewriting tests and docs to have a stable project base.
And soon ™️ we can start working on first bug fixes.

Until then I can suggest to use faker.random.arrayElement(faker.definitions.address.street_name); on your own, or try something like faker.fake('{{address.street_name}}');.

@Shinigami92 Shinigami92 added c: bug Something isn't working and removed s: pending triage Pending Triage labels Feb 14, 2022
@Shinigami92 Shinigami92 added this to the v6.1 - First bugfixes milestone Feb 14, 2022
@Shinigami92 Shinigami92 moved this to Todo in Faker Roadmap Feb 14, 2022
@ST-DDT ST-DDT added p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug labels Mar 18, 2022
@ejcheng ejcheng added the has workaround Workaround provided or linked label Apr 2, 2022
@ST-DDT ST-DDT linked a pull request May 17, 2022 that will close this issue
Repository owner moved this from Todo to Done in Faker Roadmap May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working has workaround Workaround provided or linked p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants