mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 05:12:41 +01:00
Ask users to choose a pronoun instead of sex in the Account settings panel
Summary: Fixes T4845, Use "choose a pronoun" prompt for (grammatical) gender selection instead of "Sex" Test Plan: Open Account settings panel, expand Pronoun dropdown, verify that options are "<username> updated their/her/his profile". Switch to different language, verify that pronouns propogate Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T4845 Differential Revision: https://secure.phabricator.com/D8920
This commit is contained in:
parent
23e654ec2b
commit
cf3f8cd809
1 changed files with 10 additions and 4 deletions
|
@ -17,6 +17,7 @@ final class PhabricatorSettingsPanelAccount
|
||||||
|
|
||||||
public function processRequest(AphrontRequest $request) {
|
public function processRequest(AphrontRequest $request) {
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
|
$username = $user->getUsername();
|
||||||
|
|
||||||
$pref_time = PhabricatorUserPreferences::PREFERENCE_TIME_FORMAT;
|
$pref_time = PhabricatorUserPreferences::PREFERENCE_TIME_FORMAT;
|
||||||
$preferences = $user->loadPreferences();
|
$preferences = $user->loadPreferences();
|
||||||
|
@ -54,10 +55,14 @@ final class PhabricatorSettingsPanelAccount
|
||||||
$timezone_ids = DateTimeZone::listIdentifiers();
|
$timezone_ids = DateTimeZone::listIdentifiers();
|
||||||
$timezone_id_map = array_fuse($timezone_ids);
|
$timezone_id_map = array_fuse($timezone_ids);
|
||||||
|
|
||||||
|
$label_unknown = pht('%s updated their profile', $username);
|
||||||
|
$label_her = pht('%s updated her profile', $username);
|
||||||
|
$label_his = pht('%s updated his profile', $username);
|
||||||
|
|
||||||
$sexes = array(
|
$sexes = array(
|
||||||
PhutilPerson::SEX_UNKNOWN => pht('Unspecified'),
|
PhutilPerson::SEX_UNKNOWN => $label_unknown,
|
||||||
PhutilPerson::SEX_MALE => pht('Male'),
|
PhutilPerson::SEX_MALE => $label_his,
|
||||||
PhutilPerson::SEX_FEMALE => pht('Female'),
|
PhutilPerson::SEX_FEMALE => $label_her,
|
||||||
);
|
);
|
||||||
|
|
||||||
$translations = array();
|
$translations = array();
|
||||||
|
@ -85,10 +90,11 @@ final class PhabricatorSettingsPanelAccount
|
||||||
->setName('timezone')
|
->setName('timezone')
|
||||||
->setOptions($timezone_id_map)
|
->setOptions($timezone_id_map)
|
||||||
->setValue($user->getTimezoneIdentifier()))
|
->setValue($user->getTimezoneIdentifier()))
|
||||||
|
->appendRemarkupInstructions(pht("**Choose the pronoun you prefer:**"))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormSelectControl())
|
id(new AphrontFormSelectControl())
|
||||||
->setOptions($sexes)
|
->setOptions($sexes)
|
||||||
->setLabel(pht('Sex'))
|
->setLabel(pht('Pronoun'))
|
||||||
->setName('sex')
|
->setName('sex')
|
||||||
->setValue($user->getSex()))
|
->setValue($user->getSex()))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
|
|
Loading…
Reference in a new issue