Skip to content

Commit

Permalink
Merge pull request #23482 from namhihi237/fix-22659-translate-text-hi…
Browse files Browse the repository at this point in the history
…dden

fix translate hidden
  • Loading branch information
grgia authored Jul 25, 2023
2 parents ecf0ec2 + 070e62b commit 6a4ce84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/libs/PersonalDetailsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Onyx.connect({
function getDisplayNameOrDefault(passedPersonalDetails, pathToDisplayName, defaultValue) {
const displayName = lodashGet(passedPersonalDetails, pathToDisplayName);

return displayName || defaultValue || 'Hidden';
return displayName || defaultValue || Localize.translateLocal('common.hidden');
}

/**
Expand Down
9 changes: 5 additions & 4 deletions src/pages/ReportParticipantsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ const defaultProps = {
*
* @param {Object} report The active report object
* @param {Object} personalDetails The personal details of the users
* @param {Object} translate The localize
* @return {Array}
*/
const getAllParticipants = (report, personalDetails) => {
const getAllParticipants = (report, personalDetails, translate) => {
const {participantAccountIDs} = report;

return _.chain(participantAccountIDs)
.map((accountID, index) => {
const userPersonalDetail = lodashGet(personalDetails, accountID, {displayName: personalDetails.displayName || 'Hidden', avatar: ''});
const userLogin = Str.removeSMSDomain(userPersonalDetail.login || '') || 'Hidden';
const userPersonalDetail = lodashGet(personalDetails, accountID, {displayName: personalDetails.displayName || translate('common.hidden'), avatar: ''});
const userLogin = Str.removeSMSDomain(userPersonalDetail.login || '') || translate('common.hidden');

return {
alternateText: userLogin,
Expand All @@ -85,7 +86,7 @@ const getAllParticipants = (report, personalDetails) => {
};

function ReportParticipantsPage(props) {
const participants = getAllParticipants(props.report, props.personalDetails);
const participants = getAllParticipants(props.report, props.personalDetails, props.translate);

return (
<ScreenWrapper includeSafeAreaPaddingBottom={false}>
Expand Down

0 comments on commit 6a4ce84

Please sign in to comment.