Opened 7 years ago
Last modified 6 years ago
#42900 new enhancement
Add gender field to user profile for use in translations
Reported by: | yoavf | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
See #42725 for more background.
What this solves
To be able to properly translate numerous terms across the WP codebase, translators to some languages require knowledge of the gender of the user being referenced in the string.
Adding an optional field to the user profile will enable the extension of WP's translation functions to support gender variations (see #42725)
What's included
- A new user profile field, and a matching get_user_gender()
- Unit tests for get_user_gender()
Gender/Pronouns - How the field was named
The word gender has a lot of connotations - but it's used here in the grammatical sense - see Grammatical Gender on Wikipedia.
When presented to the user, we ask what their preferred pronoun is, since that's probably the easiest way to relate to it. The wording around the field was inspired by Wikipedia's gender user profile field.
Attachments (2)
Change History (9)
#1
follow-up:
↓ 2
@
7 years ago
Personally, I think it would be less confusing to have a Gender select box with he, she and other rather than radio button and explaining it as much as it currently is.
I do like the idea though, +1.
Perhaps it would be better to, instead of having get_user_gender
as a function to return he, she or they, instead have a new translation function called _g
where it accepts a placeholder to be returned as he, she or they, or even his, her, their. I think that'd be a much more elegant solution.
I'll see if I can whip up a patch to explain further.
#2
in reply to:
↑ 1
@
7 years ago
Replying to danieltj:
Perhaps it would be better to, instead of having
get_user_gender
as a function to return he, she or they, instead have a new translation function called_g
where it accepts a placeholder to be returned as he, she or they, or even his, her, their. I think that'd be a much more elegant solution.
This is only a part of the soultion. Make sure you take a look at #42725 for the full plan
#4
@
7 years ago
About Other/Unknown:
I'm okay with the 'Other', but the 'Unknown' seems a bit strange to me.
Can we in that same button (or choice) also add 'I prefer not to disclose' somehow?
#5
follow-up:
↓ 6
@
7 years ago
I'm very opposed to having this in core by default and would suggest this could and should be plugin territory. Gender is not a necessary thing to know when creating an account. Given the privacy legislation like the GDPR I would urge us to go for privacy by design.
#6
in reply to:
↑ 5
@
7 years ago
Replying to joostdevalk:
Thanks for the feedback, Joost. The proposal is to make this an optional field that allows users to specify their preferred pronoun in order to fix grammatically incorrect translations that exist currently for many gendered phrases. This is particularly important for female users in many languages which default to using the male form of phrases such as user role names, and basically any phrase which references the user. (Aside: There are significantly more gendered phrases than I thought there would be. At WCUS we identified at least eight on the dashboard screen alone.)
The gender field won't be required when creating or editing a user account.
Can you expand on your privacy concerns? Legislation such as the GDPR doesn't dictate what data should or shouldn't be collected, only how it's protected and made manageable by the user. These points apply regardless of whether or not a user gender field is introduced.
User profile gender field, and get_user_gender()