From cf3f8cd809b463536a5c6cba5582f32b4a12b25a Mon Sep 17 00:00:00 2001 From: lkassianik Date: Wed, 30 Apr 2014 14:42:07 -0700 Subject: [PATCH] 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 " 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 --- .../panel/PhabricatorSettingsPanelAccount.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php b/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php index e4c29081b4..2384fef444 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php @@ -17,6 +17,7 @@ final class PhabricatorSettingsPanelAccount public function processRequest(AphrontRequest $request) { $user = $request->getUser(); + $username = $user->getUsername(); $pref_time = PhabricatorUserPreferences::PREFERENCE_TIME_FORMAT; $preferences = $user->loadPreferences(); @@ -54,10 +55,14 @@ final class PhabricatorSettingsPanelAccount $timezone_ids = DateTimeZone::listIdentifiers(); $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( - PhutilPerson::SEX_UNKNOWN => pht('Unspecified'), - PhutilPerson::SEX_MALE => pht('Male'), - PhutilPerson::SEX_FEMALE => pht('Female'), + PhutilPerson::SEX_UNKNOWN => $label_unknown, + PhutilPerson::SEX_MALE => $label_his, + PhutilPerson::SEX_FEMALE => $label_her, ); $translations = array(); @@ -85,10 +90,11 @@ final class PhabricatorSettingsPanelAccount ->setName('timezone') ->setOptions($timezone_id_map) ->setValue($user->getTimezoneIdentifier())) + ->appendRemarkupInstructions(pht("**Choose the pronoun you prefer:**")) ->appendChild( id(new AphrontFormSelectControl()) ->setOptions($sexes) - ->setLabel(pht('Sex')) + ->setLabel(pht('Pronoun')) ->setName('sex') ->setValue($user->getSex())) ->appendChild(