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

Make internet.avatar() sex or gender aware #2173

Closed
FrenchMajesty opened this issue May 24, 2023 · 9 comments · Fixed by #3126
Closed

Make internet.avatar() sex or gender aware #2173

FrenchMajesty opened this issue May 24, 2023 · 9 comments · Fixed by #3126
Assignees
Labels
c: feature Request for new feature m: image Something is referring to the image module m: internet Something is referring to the internet module p: 1-normal Nothing urgent
Milestone

Comments

@FrenchMajesty
Copy link

Clear and concise description of the problem

I am using Faker to generate fake user profiles. I really appreciate the fact that I can give it a sex attribute to the person.firstName() so that it would give me feminine or masculine name.

However, one issue I have is I got a user who's name is John Franken but the avatar that was attached to this person is a young blonde lol. There isn't a way to make a wholistic "fake profile" without a semi-consistent image-to-name connection.

Suggested solution

Pass in sex an an argument to the avatar() method.

I understand some images can fit anything, but there are some obvious candidates as well. (see: https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/1183.jpg)

  • If the picture contains both a male and a female, then it can classified as both.
  • If the picture is not a person (cat, drawing, etc...) it can be classified as both

Alternative

No response

Additional context

No response

@FrenchMajesty FrenchMajesty added c: feature Request for new feature s: pending triage Pending Triage s: waiting for user interest Waiting for more users interested in this feature labels May 24, 2023
@github-actions
Copy link
Contributor

Thank you for your feature proposal.

We marked it as "waiting for user interest" for now to gather some feedback from our community:

  • If you would like to see this feature be implemented, please react to the description with an up-vote (:+1:).
  • If you have a suggestion or want to point out some special cases that need to be considered, please leave a comment, so we are aware about them.

We would also like to hear about other community members' use cases for the feature to give us a better understanding of their potential implicit or explicit requirements.

We will start the implementation based on:

  • the number of votes (:+1:) and comments
  • the relevance for the ecosystem
  • availability of alternatives and workarounds
  • and the complexity of the requested feature

We do this because:

  • There are plenty of languages/countries out there and we would like to ensure that every method can cover all or almost all of them.
  • Every feature we add to faker has "costs" associated to it:
    • initial costs: design, implementation, reviews, documentation
    • running costs: awareness of the feature itself, more complex module structure, increased bundle size, more work during refactors

View more issues which are waiting for user interest

@matthewmayer
Copy link
Contributor

see also discussion at #465

@matthewmayer matthewmayer changed the title Make interner.avatar() sex or gender aware Make internet.avatar() sex or gender aware Jun 18, 2023
@xDivisionByZerox xDivisionByZerox added m: internet Something is referring to the internet module and removed s: pending triage Pending Triage labels Jul 4, 2023
@AaronNGray
Copy link

It would been good to have both faker.person.sex() and also faker.person.gender() to allow for fluid genders, which can randomly be mapped to sex or we have four types which can be mapped to sex via a function..

faker.person.genderToSex(gender:string):string

or introduce real types rather than enumerated types ?

faker.person.genderToSex(g:gender):sex

and for faker.person.firstName(sex:string) to take a string rather than a typed object ??? Why theres typed objects were introduced instead of strings is very odd as it requires :-

    const gender = faker.person.sex();
    const firstName = faker.person.firstName(gender == "male" ? "male" : "female");

Then to have a faker.person.avatar(sex:string) too.

@matthewmayer
Copy link
Contributor

Bear in mind locales (we want "male" and "female" in different languages) and the need for this to work easily when using vanilla JavaScript as well as typescript.

@AaronNGray
Copy link

Gender pronouns would be too.

@matthewmayer
Copy link
Contributor

We do have an open issue for pronouns, if that interests you you can upvote #1248

@AaronNGray
Copy link

Gender from faker.person.gender() maybe a string with a colon "male:female" being sex:birth_sex maybe ?

@ST-DDT
Copy link
Member

ST-DDT commented Jan 2, 2024

faker.person.firstName(sex:string) to take a string rather than a typed object ??? Why theres typed objects were introduced instead of strings is very odd as it requires :-

    const gender = faker.person.sex();
    const firstName = faker.person.firstName(gender == "male" ? "male" : "female");

The code you are showing only works for English. For that reason we have introduced a method faker.person.sexType() that returns a value that will always work for that and is typed accordingly.

@matthewmayer
Copy link
Contributor

Note this can now be achieved by using faker.image.personPortrait({sex:"male"}) etc

@ST-DDT ST-DDT added this to the v9.x milestone Feb 10, 2025
@ST-DDT ST-DDT added m: image Something is referring to the image module p: 1-normal Nothing urgent and removed s: waiting for user interest Waiting for more users interested in this feature labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature m: image Something is referring to the image module m: internet Something is referring to the internet module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants