-
-
Notifications
You must be signed in to change notification settings - Fork 944
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
feat(name): add hyphenated patterns to lastName()
#691
Comments
IMO there are three possible solutions.
As I'm not sure whether this actually a thing in all locales, maybe we should add it to the locale files directly? |
@ST-DDT Yes, I don't think hyphenated last names are a thing in all locales. On another somewhat related note, what about locales with two or more surnames? Some Spanish names have multiple surnames. |
IMO if you request a single surname, you only get one (hyphenated or not). faker/src/locales/en/name/name.ts Lines 2 to 7 in a64cbde
This is the old format that was never usable. That way we can generate |
Yes, this method would work really well. |
|
The locale data/fake name pattern needs to be updated accordingly. |
hyphenated
option to name.lastName()
hyphenated
option to lastName()
I am interested in this issue. May I be assigned, please? |
Sure! |
hyphenated
option to lastName()
lastName()
Sorry to just pop in, I just wanted to add that some locales (United Kingdom for example) use both hyphenated and non-hyphenated (with the latter having terrible support sadly) - for example: Olivia Newton-John and Andrew Lloyd Webber. There are also some compounded surnames with more than 2 surnames which also may or may not be hyphenated (although as far as I am aware, these are less common)
I think this would mean that such combinations can be generated by specifying different patterns? |
@markscamilleri Yes, but then it would only work for the fullName method. I think, if two ore more names (hypenated or space separated) are possible for surnames in the UK, then we should add some samples to the en(_GB?).person.last_name locale data directly. @conner-c Any progress so far? |
Thanks @ST-DDT! Well techncally, they're multiple surnames combined into one (usually to keep both family names after marriage) - however on legal documentation (birth certificates, passports, ID cards and drivers licenses) these would be treated as a single surname. So I guess it would make more sense to have these in samples in the locale data. Such surnames are also allowed in other I think this would be different to what @conner-c is working on? If it is, I'm happy to open up another issue and work on it. |
No, I think that is exactly what conner-c is working on. If they dont react in a week or so you can take over. |
I have been busy, so I have not had much time to work on it. It seems like @markscamilleri is currently displaying more interest than me and seems to have a better understanding of the issue. Feel free to unassign me and assign them to the issue. Sorry for such a late response. |
Now that the fullName pattern code has landed this can be revisited Seems there are two possible strategies
|
This could be fixed via #1819 |
We should discuss if we want hyphenated patterns in the default en locale? |
Please accept my apologies for not working on this. I wanted to work on it, but I went through some life events that left me unable to deidcate the time for it. I understand I should have spoken up earlier but I was still hoping I could contribute to this. |
Thanks for letting us know. If you ever have time and interest to contribute again, feel free to do so. |
Clear and concise description of the problem
The ability to generate hyphenated last names so that it seems just a little bit more realistic. The function only generates single last names currently.
Suggested solution
Add a boolean option
hyphenated?
Alternative
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: