Skip to content

Commit

Permalink
Merge pull request #6419 from Expensify/alberto-fixPronouns
Browse files Browse the repository at this point in the history
Strip prefix and translate pronouns when needed

(cherry picked from commit 1e88ca5)
  • Loading branch information
Beamanator authored and OSBotify committed Nov 23, 2021
1 parent 0fa74fd commit b8001c0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/ReportWelcomeText.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import withLocalize, {withLocalizePropTypes} from './withLocalize';
import compose from '../libs/compose';
import {getPersonalDetailsForLogins} from '../libs/OptionsListUtils';
import ONYXKEYS from '../ONYXKEYS';
import CONST from '../CONST';


const personalDetailsPropTypes = PropTypes.shape({
Expand Down Expand Up @@ -53,10 +54,15 @@ const ReportWelcomeText = (props) => {
const longName = displayName || Str.removeSMSDomain(login);
const longNameLocalized = Str.isSMSLogin(longName) ? props.toLocalPhone(longName) : longName;
const shortName = firstName || longNameLocalized;
let finalPronouns = pronouns;
if (pronouns && pronouns.startsWith(CONST.PRONOUNS.PREFIX)) {
const localeKey = pronouns.replace(CONST.PRONOUNS.PREFIX, '');
finalPronouns = props.translate(`pronouns.${localeKey}`);
}
return {
displayName: isMultipleParticipant ? shortName : longNameLocalized,
tooltip: Str.removeSMSDomain(login),
pronouns,
pronouns: finalPronouns,
};
},
);
Expand Down

0 comments on commit b8001c0

Please sign in to comment.