-
-
Notifications
You must be signed in to change notification settings - Fork 943
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
Incorrect behavior of name.firstName()
function
#547
Comments
Yeah, thx, we already know that the name functions are really buggy 🙁 |
thanks, maybe there is a problem in the code here: Lines 38 to 65 in 03c3d11
at least it differs from what is in the lastName and middleName functions, which work correctly |
I mean... that is quite the whole function except of 2-3 lines 😉 |
Needs re-evaluation after #644 was merged |
Yes, that is freshly implemented by us 🙂 |
This issue is more complex then it looks like. The basics:
The possible solutions:
The All |
yes, it looks like when specifying localeFallback in ru, the code works correctly If I understand correctly, the third option (indicate male and female names (surnames, patronymics) in the general array) is acceptable |
Team decision Change data-structure: name.female_first_name ->person.first_name.female Example: type Gendered = {
female: string[]
male: string[]
generic: string[]
}; |
Maybe I'm missing somethng, but isn't the simplest solution to add a first_name.ts file to locales which are missing one which simply concatenates the existing male_first_name and female_first_name lists? Had a go at this in #1610 |
If you add a new locale or change the locale config (for most of the parts in person), then you will encounter the bug again. |
The effect of the bug is fixed. The implementation/structure should still be adjusted accordingly. |
Further changes tracked via #1677 |
Describe the bug
When using the faker.name.firstName() function with a non-standard locale and without passing a gender value to the function, the name is still displayed in English.
Reproduction
For example:
demo: https://stackblitz.com/edit/faker-js-demo-6fb7x2?file=index.ts
Additional Info
No response
The text was updated successfully, but these errors were encountered: