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

Clean up generic prefixes #3058

Open
matthewmayer opened this issue Aug 15, 2024 · 3 comments · May be fixed by #3259
Open

Clean up generic prefixes #3058

matthewmayer opened this issue Aug 15, 2024 · 3 comments · May be fixed by #3259
Assignees
Labels
c: locale Permutes locale definitions m: person Something is referring to the person module p: 1-normal Nothing urgent
Milestone

Comments

@matthewmayer
Copy link
Contributor

          `generic` is intended for cases that don't represent male or female specifically.

In this case it looks like it is just the union of male and female, so it can now be omitted, because it will fallback to the gendered version automatically if it cannot find generic ones.

Originally posted by @ST-DDT in #3020 (comment)

@matthewmayer
Copy link
Contributor Author

Note this should be cleaned up in other locales e.g. https://github.com/faker-js/faker/blob/next/src/locales/en/person/prefix.ts where generic is just the union of male and female.

@matthewmayer
Copy link
Contributor Author

Currently en has:

export default {
  generic: ['Dr.', 'Miss', 'Mr.', 'Mrs.', 'Ms.'],
  female: ['Mrs.', 'Ms.', 'Miss', 'Dr.'],
  male: ['Mr.', 'Dr.'],
};

which should be

export default {
  female: ['Mrs.', 'Ms.', 'Miss', 'Dr.'],
  male: ['Mr.', 'Dr.'],
};

although i'd argue it would be more sensibly written as

export default {
  generic: ['Dr.'],
  female: ['Mrs.', 'Ms.', 'Miss'],
  male: ['Mr.'],
};

However that won't work currently (as generic takes priority, so everyone would be Dr). Perhaps selectDefinition should return randomly from the generic plus female/male lists when sex is undefined?

@ST-DDT ST-DDT added p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision m: person Something is referring to the person module c: locale Permutes locale definitions labels Aug 16, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Aug 16, 2024
@ST-DDT
Copy link
Member

ST-DDT commented Nov 12, 2024

Team Decision

@ST-DDT ST-DDT removed the s: needs decision Needs team/maintainer decision label Nov 12, 2024
@ST-DDT ST-DDT self-assigned this Nov 12, 2024
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: person Something is referring to the person module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants